Statalist


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

st: RE: A beginner's trouble with dates


From   "Steichen, Thomas J." <SteichT@rjrt.com>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: A beginner's trouble with dates
Date   Mon, 23 Jun 2008 17:12:54 -0400

The month() function expects the date to be in %td, not %tc format.

You can convert "on the fly" as:

generate ICUmonth=month(dofc(date))

tom

-----------------------------------
Thomas J. Steichen
steicht@rjrt.com
-----------------------------------

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Eduardo Palencia
Sent: Monday, June 23, 2008 4:58 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: A beginner's trouble with dates

I am building a database of daily activity in an ICU, and each day I
have a new row. I am planning to analize data by month. My variable
"date" is double, and has the format %tc.
I want to extract the month of the date in a new variable, "ICUmonth", this way:

generate ICUmonth=month(date)

Variable ICUmonth is created, but all its generated values are missing
values. Why?

Thanks in advance,
Eduardo

--
Eduardo Palencia Herrejón
Jefe de Servicio de Medicina Intensiva
Hospital "Infanta Leonor", Madrid
C/ Gran vía del Este, 80
28031 Madrid
Tfno: +34619204428
Fax: +34911919099
edupalher@gmail.com

*
*   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/

-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be
unlawful.   

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