Bookmark and Share

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]

Re: st: RE: date formatting


From   Rodrigo Briceño <[email protected]>
To   [email protected]
Subject   Re: st: RE: date formatting
Date   Tue, 12 Oct 2010 15:20:30 -0600

thanks Nick and Phil. That's what I needed!

2010/10/12 Nick Cox <[email protected]>:
> I don't have access to Stata 9 but will make various guesses: something like
>
> gen date = cond(_n <= 185705, date(t, "dmy"), date(t, "mdy"))
>
> seems called for.
>
> Nick
> [email protected]
>
> Rodrigo Briceño
>
> I'm using stata 9  and windows XP. I need to format
> a date variable in order to be able to define a panel dataset. My time
> variable (t) is in the format day/month/year, but the tricky thing is
> that this format changes for a specific set of observations. From
> 1-185705 the time variable is dd/mm/yy, but from 185706-360288 the
> format is mm/dd/yy. I imported the data from excel using insheet.
>
> Before knowing about the existence of the two different formats of
> time in my variable I used: generate t2=date(t,"dmy"), but then a lot
> of missing values appeared. What do you think it is plausible to be
> used so I can get my new time variable (t2) that considers the
> differences in formats already present in my stata dataset?
>
>
> *
> *   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/
>



-- 
Rodrigo Briceño
Economist
[email protected]
MSN: [email protected]
SKYPE: rbriceno1087

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