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, statalist.org is already up and running.


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

st: Converting year variable into a date variable


From   Erik Aadland <erikaadland@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Converting year variable into a date variable
Date   Thu, 22 Nov 2012 10:47:19 +0000

Dear Statalist.
I have a panel dataset in which I have the variable -year- that contains values of e.g. 1998, 1999, etc.
I want to make a new -year2- variable and convert this one into a date variable. 
In particular, I want to convert each -year2- value into the last date for that year so that e.g. 1998 == 31.12.1998, 1999 == 31.12.1999, etc.
How can this be accomplished? 
Any input on this would be greatly appreciated.
Kind regards,
Erik. 		 	   		  
*
*   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/


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