I want to create a continuous day variable from January 1, 1991, to June 12, 1991. For instance, I expect February 1 to be day 32 (after January 31 which should be day 31) and February 3 to be day 34. My data variable is like this:
Date
Jan 01, 1991
Feb 19, 1991
Jan 03, 1991
Feb 22, 1991
Jan 02, 1991
Feb 26, 1991
Jan 02, 1991
Mar 01, 1991
I tried gen day1=day(Date) but it did not work. The day number starts over from the first day of each month. Any help would be appreciated.
Related Posts with Creating a day variable
How to check correlation among 2000+ variables in a quick way?Hi, all, I had a data set of 2000+ variables (all binary or categorical), for example, 1000+ are …
From SPSS to StataDear All, I need some help in converting a couple of SPSS files to Stata 13. Thanks, Dapel …
Plotting a (curvilinear) mediated relationI am working with a mediated-moderated model like that in Fig. 1. All variables in the model are con…
Can anyone explain to me what the meaning of %9.0g is?I'm confused about Stata formats. I try to see Stata help format file, but I'm still confused. …
Convert composite string variable delimited by commas into separate dummy variablesHi, I have observations of building tenants which has a string variable recording the floors they oc…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a day variable
Post a Comment