Statalist


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

Re: st: date function


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: date function
Date   Wed, 6 Feb 2008 16:22:13 -0500

This will do it:

di ceil(strpos("jan feb mar apr may jun jul aug sep oct nov dec", "oct")/4)

Sergiy Radyakin





On 2/6/08, Visintainer, Paul <[email protected]> wrote:
> Is there a date function that converts a string variable containing only the text of the month into a numeric version of the month?  e.g.:  X has string values October, April, December, etc.  I want to create a new variable that is numeric with numbers 10, 04, 12, etc.   I thought -monthly( )- would do it, but I can't seem to get the right syntax.
>
> Thanks.
>
> -p
>
>
> ______________________________________
> Paul F. Visintainer, PhD
>
> *
> *   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