Ah! Exactly what I needed. Thank you Kit.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kit Baum
Sent: Tuesday, 22 December 2009 3:45 p.m.
To: [email protected]
Subject: st: re: moving averages in panel data
<>
Darian said
Thanks. Although 'tssmooth ma' doesn't seem to work because my data is not time-series data. In fact, it's not even panel data. It's product by country by year. So each year in each country has multiple observations due to the different products. That means that 'tsset year' or 'tsset year country' doesn't work, which makes tssmooth not work either.
Help with either moving averages or tips on working with this two-cross-sections-and-time data would be appreciated (without reshaping).
You can form a panel where the unit is the country-product, e.g. kiwi fruit exported by NZ. For that you have a time series. Use egen group() function to form a counter for each combination of country and product, and use that as the panel id variable. Then all time series functions will work properly.
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
*
* 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/