Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: Week data, daily data, and end-of-year


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: Week data, daily data, and end-of-year
Date   Wed, 2 Dec 2009 13:40:08 +0100

<> 


You want to peruse
http://www.stata.com/statalist/archive/2009-11/msg00265.html before
proceeding...



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Sauermann J
(ROA)
Gesendet: Mittwoch, 2. Dezember 2009 13:39
An: '[email protected]'
Betreff: st: Week data, daily data, and end-of-year

Dear Statalist, 

I have a dataset containing week information. The variable --week-- is
generated from a year variable (2008, 2009) and a week variable (1,...,52).
Weeks are defined as calendar weeks, i.e. always ranging from Monday until
Sunday. The week "1" of a year are thus a whole week (Mon-Sun) where at
least 4 days are in the new year (i.e. for the past two years, week "1"
overlaps new year's eve).

Stata defines week "1" as the first 7 days in the new year, i.e. January
1-January 7, irrespective of the weekdays. December 31, 2008 (Wednesday) was
for instance week "2547" while January 1, 2009 (Thursday) was week "2548". 

Next to the weekly data, I have an additional dataset which is based on
daily data. To use it properly, I transformed it using Stata to weekly data.
This obviously gives wrong results since the week break in Stata may be in
the middle of the week, while the week break in my weekly data is
Sunday/Monday. 

Is there any way to tell Stata to use a date format where week "1" of a year
is the first week with at least 4 days in the new year?

[I guess one solution would be to manually generate own week counters which
can be matched properly]


Many thanks in advance,

Jan



Jan Sauermann
Researcher

Research Centre for Education and the Labour Market
Maastricht University | ROA
P.O. Box 616, NL-6200 MD Maastricht
T +31 43 3883801 F +31 43 3884914


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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