Bookmark and Share

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]

Re: st: Converting MM, YY varkables into a date variable


From   Michael McCulloch <mm@pinestreetfoundation.org>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Converting MM, YY varkables into a date variable
Date   Tue, 1 Feb 2011 14:44:29 -0800

You can assume "day" is any day of the month, for example the 1st day. 

*to make your variable, which we can call edate,
	gen DD=1
	gen edate = mdy(MM, DD, YY)
*to confirm accuracy, compare visually:
	list MM DD YY edate	

On Feb 1, 2011, at 2:37 PM, Jung-eun Lee wrote:

> Hello,
> I need help with converting month and year variables into a date variable so that I can use it for a time-series analysis.
> Year variable: YY (looks like 1992, 1993, 1994...)
> Month variable: MM (looks like 1, 2, 3, 4...)
> Please help!
> Thanks!!!!
> 
> 
> 
> *
> *   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/


Best wishes,

Michael McCulloch, LAc MPH PhD
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391


*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index