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
Using vignette answers in a multinominal logistic regressionHi I've made a vignette study, where there is 8 versions of the vignette, but respondents have only…
Drop variables if total sum is the largestDear all, I’m working with a dataset of 396 observations and 148 variables. I’m trying to drop a var…
Pseudo Poisson gravity model of public procurement market - with and without zeros.Hi everybody! I am currently working on my graduation thesis and I have a few issues with my model a…
Reformulating a problem based on the symmetry of interactive effects?Dears, I am conducting a study on social mobility in Brazil using a survey of 2014. The study uses …
Expanding datasets to all possible combinations of a variableHi, I have a dataset containing 2 variables: id (unique identifier) and postal code. The table belo…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a binary varible from a date variable
Post a Comment