On Wed, 25 Jul 2007, Eric G. Wruck wrote:
I was trying to use the week function to graph weekly totals. However, I get
some squirrelly results. Am I doing something wrong or have I uncovered a
bug?
. gen week = week(date2)
. format week %tw
. l date2 week
+---------------------+
| date2 week |
|---------------------|
1. | 16jul2007 1960w30 |
2. | 17jul2007 1960w30 |
+---------------------+
Eric,
I suspect you want to use the wofd() function instead:
. gen week2 = wofd(date2)
. format week2 %tw
. list date2 week2
+---------------------+
| date2 week2 |
|---------------------|
1. | 16jul2007 2007w29 |
2. | 17jul2007 2007w29 |
+---------------------+
Both those dates occurred in the 29th week of 2007.
-- Brian Poi
[email protected]
*
* 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/