Statalist


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

Re: st: RE: recording date and year


From   "Yun Liu" <[email protected]>
To   [email protected]
Subject   Re: st: RE: recording date and year
Date   Wed, 2 Jul 2008 13:06:36 -0400

Bret,

That's a smart idea. Thank you!

Yun

On Wed, Jul 2, 2008 at 12:55 PM, Howrey, Bret T. <[email protected]> wrote:
> Yun,
> If the last 2 chars are always the year (and year is all you need) then combine string functions to extract the last two chars.  Something like:
>  gen new_dob="19"+substr(old_dob,length(dob)-2,2)
>
> Maybe.
> Bret
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Yun Liu
> Sent: Wednesday, July 02, 2008 11:48 AM
> To: [email protected]
> Subject: st: recording date and year
>
> Hi,
>
> I have a question about recording date and year. I am dealing with a "date of birth" variable stored in an excel file. In some cases, it's a year. In some cases, it's month and year. In other cases, it's date and year. For examples,
>
> 1965
> Nov-47
> 1952
> 1952
> 1953
> 10-Oct-40
>
> What would be the best way to record this variable in stata? Thank you!
>
> Yun
> *
> *   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/
>
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index