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: Thread-Index: Ac0vkoq1llKC2ARGRdCKzJ3Uorh9sgCG7a8+
From
Amal Khanolkar <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Thread-Index: Ac0vkoq1llKC2ARGRdCKzJ3Uorh9sgCG7a8+
Date
Mon, 14 May 2012 08:49:12 +0000
Hi,
I just received a dataset which has a 'date variable in a format I
haven't come across before. I need help with reformatting this date
variable so that it's similar to other date variables I have in the
dataset.
The date variable reads like this when I 'summarize' and 'decribe' it:
sum inskdat_new
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
inskdat_new | 305358 818.8836 613.712 1 2441
. des inskdat_new
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
inskdat_new long %d inskdat_new
enlistment date
-As you can see from the above, the date has a min value of 1 that
corresponds to 1997-06-23 and a maximum value of 241 that corresponds
to 2009-02-04.
-How do I reformat this variable so that it's a 'float' with %d display
format and reads like 19feb2010 when I tabulate it and with stata time
(when checking the minimum & maximum values when I summarize the
variable)??
Any help will be much appreciated!
Thanks,
/Amal.
Amal Khanolkar, PhD candidate,
Centre for Health Equity Studies (CHESS),
Karolinska Institutet,
106 91 Stockholm.
Ph# +46(0)8 162584/+46(0)73 0899409
www.chess.su.se
*
* 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/