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
Related Posts with Creating a binary varible from a date variable
About the 2-Step weighting matrixDear Statalisters, I've two questions about the weighting matrix in two-step GMM. Theoretically the…
Out-of-sample R2 forecastingHi everyone. Im currently writing my thesis and got advised to compare In-sample vs Out-of-sample p…
Duplicates HelpI'm starting a new thread (old one was: https://www.statalist.org/forums/for...ific-duplicate) but I…
Seconds base date & Differing units of analysis: Generate variable containing differences between first and last second of a unitDear all, I am trying to work my way into stata and I read a lot about how to build differences, bu…
Panel data regression with high coefficients valuesDear All I have estimated a panel regression with command ' xtreg, fe cluster(id)'. (22 panels and …
Subscribe to:
Post Comments (Atom)
0 Response to Creating a binary varible from a date variable
Post a Comment