Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Problems with date format

From   Morten Støver <>
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:

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