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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: Problems with date format


From   Morten Støver <morten.stover@ntnu.no>
To   statalist@hsphsun2.harvard.edu
Subject   st: Problems with date format
Date   Tue, 07 Jun 2011 13:13:29 +0200

I'm trying to make dummy-variables for whether people has received disability pension up to a certain date. If the respondents have received it before 1993, before 1994, etc.

I'm trying with this code, where "exit2" is the date of disability pension:

gen disability92=0
replacedisability92=1 if exit2<01011993
gen disability93=0
replace disability93=1 if exit2<01011994

This code makes all my respondents with disability pension in the follow up-period have value 1, instead of only the respondents before the dates 01011993, 01011994, etc.

So I guess there have to be a problem with the date format, and when I run "codebook exit2" I get:

type:  numeric daily date (int)

                 range:  [10958,17623]                units:  1
       or equivalently:  [01jan1990,01apr2008]        units:  days
         unique values:  295                      missing .:  0/2784

I guess there is a quite simple solution to this, but now I'm just stuck. I hope someone can help. I'm running Stata 11.





*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index