Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: how to generate day of week


From   [email protected]
To   [email protected]
Subject   st: Re: how to generate day of week
Date   Sat, 18 Jan 2003 19:13:58 -0500

Radu,
With variables for month, day (for day-of-month), and year, I get
day of week in variable dow with
  .gen dow = dow( mdy( month, day, year) )
and this gives 0=Sunday,...,6=Saturday.
You said you have date, month, and year, and if date is in string form,
you can unpack it with datefcn.
For more date information, start with .help dates.
Howard
----- Original Message -----
From: "Radu Ban" <[email protected]>
To: "statalist" <[email protected]>
Sent: Saturday, January 18, 2003 4:00 PM
Subject: st: how to generate day of week


> Dear all,
>
> I have variables with the date, month, and year of a certain visit. How do
I
> generate the day of the week from these variables?
>
> Thanks so much,
>
> Radu Ban
>
>
>
> *
> *   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