Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: define variable to be date

From   "Braunfels, Philipp (Stud. SBE / Alumni)" <>
To   "" <>
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:


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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index