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/