Statalist The Stata Listserver


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

RE: st: Re: How To get 4-digit Year Number


From   "Akihito Tokuhara" <akitoku4@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: Re: How To get 4-digit Year Number
Date   Thu, 16 Mar 2006 22:11:14 -0600

Dear Nick Cox,

By the way, what if the dates are in other forms, such as 11/1937, or 23101988, etc. ?

I think of something like :

generate qyr = date(dateinc, "mdy" | "my" | "string-here" | etc. )

to read and then do other steps. But I can't make it work, at least with format "my" ?

Even when using qyr = monthly(dateinc) if (some specific conditions), I can't get the
4-digit year number from format "my".

Thanks again in advance.

Akihito

----------------

From: "Akihito Tokuhara" <akitoku4@hotmail.com>
Reply-To: statalist@hsphsun2.harvard.edu
To: statalist@hsphsun2.harvard.edu
Subject: st: Re: How To get 4-digit Year Number
Date: Thu, 16 Mar 2006 14:53:42 -0600

Thank you Nick Cox, for your suggestion. It works fine, if not perfectly.

Your understanding is correct. Probably my writing is not clear, as I try
to look for few lines of code to solve two cases (one has only year number,
the other is date as usual).

But your two-step appraoch is much simpler and clear. I appreciate your
time and experience.

Best Regards,

Akihito

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

*
* 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/
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

*
* 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–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index