0

I have a dataset that includes per respondent three variables with his full date of birth (day, month, year). I want to create a dummy variable based on a range of date of birth. For example, those born between December 1, 1948 and August 31, 1949 should be labeled as intervention group, while those born between September 1, 1949 and May 31, 1950 should be the comparison group.

I think that a dummy variable would be a good way to denote these groups, where 1 represents the intervention group, and 0 the comparison group.

However, not all respondents in the dataset have these dates of births, some cannot be considered intervention or comparison group participant.

What would be the best way to do this? Later on, I want to use the dummy variable in a regression analysis. There I can only include those participants either in the comparison or intervention group.

Can anyone please help me with this? I can't find the solution on my own.

Thanks already!

  • 1
    so what is the question? are you asking how to create the dummy variable, or if this is the right way to do the analysis? – eli-k Jan 17 '18 at 08:41

1 Answers1

0

You can create your dummy variable via syntax, for example like this:

if(birthyear>=1978) dummy=1. if (birthyear<1978) dummy=0. execute.

I have never worked with that function but in spss you can define a variable as containing a date, I believe. I assume it enables you to use a date in whatever format spss requires as if being a number.

Marc
  • 11
  • 1