Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: define variable to be date
From
"Braunfels, Philipp (Stud. SBE / Alumni)" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: define variable to be date
Date
Sun, 17 Jun 2012 20:40:44 +0200
Dear Statlisters,
I reshaped my panel-dataset from wide to long format and now have a variable called "month" that serves as date variable in my dataset (covering 10 years). Now I want to run the <xtset> command but apparently "month" is not identified as date variable by stata (current type is "float"). The variable Month looks as follows:
Month
12001
22001
32001
...
112001
122001
12002
...
I looked at the stata archive but still cannot figure out how I can tell stata that the values (e.g. 12001) are supposed to be dates (e.g. Jan 2001). I tried the command - gen date = date(month, "MY") - but I am returned "(r 109) "type mismatch". I would appreciate any help on this issue.
Thanks in advance!
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/