Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: converting weekly to monthly data


From   tashi lama <[email protected]>
To   <[email protected]>
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: [email protected]
> To: [email protected]
> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index