Statalist


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

Re: st: working with dates


From   rraciborski@gmail.com
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: working with dates
Date   Mon, 21 Jul 2008 12:45:35 -0400

format %d varname



On 7/21/08, Diego Bellavia MD <bellavia.diego@mac.com> wrote:
> Dear Statalisters,
>
>
>
> Here it is my (hopefully simple) problem in STATA 10, Windows environment:
>
> I have a variable reporting dates of an intervention (date_baseline)
>
> Then I would like to create a second variable simply going
>
> 100 days forward date_baseline (let us call it date_followup).
>
>
>
> I tried with
>
>
>
> Gen date_followup = date_baseline + 100
>
>
>
> But unfortunately it creates a new variable reporting date
>
> (well I hope at least) not in MDY format but some thing like
>
>
>
>   1. | 17103 |
>
>   2. | 17113 |
>
>   3. | 16518 |
>
>   4. | 17106 |
>
>   5. | 16697 |
>
>
>
> Etc..
>
>
>
> The I tried to convert these numbers in dates using
>
>
>
> tostring date_followup , replace format(%20.0f)
>
>
>
> replace date_followup= date(followup , "MDY")
>
>
>
> But it creates only missing values.
>
>
>
> How can I fix the problem ?
>
>
>
> Thank you in advance,
>
>
>
> Diego
>
>
*
*   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   |   What's new   |   Site index