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 monthly values to quarterly averages


From   Christopher Baum <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Converting monthly values to quarterly averages
Date   Thu, 21 Feb 2013 12:14:53 +0000

<>
On Feb 21, 2013, at 2:33 AM, Anusha wrote:

> I have data at a monthly frequency by industry across years and would like to create quarterly averages by industry and year. I tried the tscollap command after specifying that the data was a panel and get an error that time-series operators not allowed. Please advise.

The latest version of -tscollap- is on SSC. The help file reads:

tscollap is for use with time-series data of monthly, quarterly, or half-yearly
frequency.  You must tsset your data before using tscollap; see help tsset.
If the data are a panel of timeseries (i.e. if a panelvar has been specified
in tsset) the specification of the panel identification variable will 
automatically be retained in the resulting dataset (it need not, and should not,
be specified in the varlist).  Time-series operators may not be used. 

As indicated, you must -tsset- the monthly data. The ym(year,month) function can be used to combine a year and month number into a single variable, and you can then tsset panelvar ymvar, monthly. 

As the help file says, you cannot include time-series operators in the -tscollap- varlist, but that would not stop you from creating something like dx = D.x and specifying that variable. 

Kit

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                             An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html
                                                                                                   | http://www.crup.com.cn/Item/111779.aspx	


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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index