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: How to convert date saved as string in the form of yyyymm
From
David Ashcraft <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: How to convert date saved as string in the form of yyyymm
Date
Sun, 29 Dec 2013 12:48:39 -0800 (PST)
I have monthly panel data for which date is a string variable in the format 2013m1. Now I want to convert this date into stata readable date format. I tried following:
gen date2 = date(date, "ym")
(133566 missing values generated)
or
gen date2 = date(date, "yyyymm")
results are same for both. Can anyone please help me resolve this.
Regards
David Ashcraft
PhD Candidate
Bangor University
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/