Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

RE: st: converting weekly to monthly data


From   tashi lama <ltashi32@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: converting weekly to monthly data
Date   Thu, 28 Jun 2012 18:07:56 +0000

there isn't a machinery to change weekly to monthly directly. However, you could change weekly into daily first and then montly from daily. May be sth like this...

 

gen daily=dofw(tw) 

format daily %td 

gen monthly=mofd(td) 

format monthly %tm

 

Alternatively, you could also do 

 

gen monthly=mofd(dofw(tw))

format monthly %tm

 

The codes aren't tested. For more on stata data.... help date in command window

 

Hope it helps, 

Tashi 

----------------------------------------
> From: jmale117@hotmail.com
> To: statalist@hsphsun2.harvard.edu
> Subject: st: converting weekly to monthly data
> Date: Thu, 28 Jun 2012 17:37:27 +0000
>
> hii all i got weekly sales data that i need to convert to monthly, but iam not sure how to do this, as the number of weeks in a month is not exactly 4
> can any one help
> my data looks like this
>
> 2010 week 1 7677
> 2010 week 2 5466
> 2010 week 3 6776
> ..
> 2010 week 53 7774
>
>
>
> 2011 week 1 4567
> ...
> 2011 wek 52 4990
>
> thanks inadvance
>
> *
> * 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index