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
Calculate vertical spilloversDear Stata users I would like to construct vertical spillovers of fdi for upstream and downstream in…
Dropping obs in a frame and expand to linked frame the selectionHi, I'm currently working on a frame linked m:1 to another. I deleted some obs from the dataset and …
third root for negative valuesHey guys, I have positive and negative values and a lot of outliers in my data. Therefore I decided…
Converting GPS data from Decimal Minutes Seconds to Decimal DegreesHi Statalisters, I need to convert GPS longitude and latitude data from the Decimal Minutes Second …
spivregI use the spivreg routine from STATA and would like to compare the estimates obtained with the usual…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a binary varible from a date variable
Post a Comment