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
Reghdfe and margins?Hi, I am using reghdfe (nov19 versions) and need to estimate margins after that (I know there used …
How to select 1:2 matched sample without using "joinby"? Dear Statalists, Part of my data is as follows. Code: * Example generated by -dataex-. For more in…
How to create a new dataset from r(name) after a r-class command I would like to ask how to create a new dataset from r(name) after a r-class command I am analy…
Create parent child links in panel dataHi everyone, I am working with a panel data set and want to create intergenerational linkages betwe…
testing marginal effects after bivariate probit modelDear all, I estimate 3 bivariate probit models (for three countries), using biprobit command with r…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a binary varible from a date variable
Post a Comment