Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: dates


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: dates
Date   Fri, 17 Aug 2007 17:03:07 -0400

It looks like your exitdate is actually an encoded string variable and not really a Stata date variable. Try:

label list exitdate
or
sum exidate

to see if there is a value label that makes it look like it holds dates but the true numeric values are not Stata date values. If so, you may need to decode the variable, then apply the date() function to the string variable to re-create it as a true date formatted numeric field.

M Blasnik


----- Original Message ----- From: "P chrisman" <peggyc@u.washington.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Friday, August 17, 2007 4:35 PM
Subject: Re: st: dates



Dear List

I tried this and keeping getting the message that no changes were made when there are definitely changes that should have been made.


. replace exitdate=mdy(12,31,2005) if year(exitdate)==2006
(0 real changes made)

I do not know what it means but when browsing data the "exitdate" is in blue with dashes and "entrydate" is in black with spaces. The formats are:

describe exitdate entrydate

storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
exitdate long %dD_m_Y exitdate entrydate long %dD_m_Y
I am confused why this command in not capturing the dates I need to change.
Thanks,
Peggy

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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