I would like to create a variable where there is only two variables (0=heating, 1=non-heating)
I have the following date variable
startdate
DDMMYYY
Originally I would like to;
gen season=.
recode season .=o if startdate==01nov-31april
recode season .=1 if startdate==01may-31oct
But I don't know how apply the range from a date variable.
Any help is very much appreciated
Best
Charlotte
0 Response to Creating a binary varible from a date variable
Post a Comment