Statalist


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

st: AW: egen(more) panel data MA by group/year


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: egen(more) panel data MA by group/year
Date   Mon, 17 Aug 2009 21:31:03 +0200

<> 

-ma()- is not even advertised in the -help egen-. Have you tried your luck
with - tssmooth ma-?



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Steven
Archambault
Gesendet: Montag, 17. August 2009 21:28
An: n.j.cox@durham.ac.uk; statalist@hsphsun2.harvard.edu
Betreff: st: egen(more) panel data MA by group/year

Hi all,

I am trying to get a moving average for a group of observations, per
year, in my panel data. The data observations are individuals, each
with an ethnicity. I want to get the yearly average income of those
individuals by ethnicity.

Essentially, I am trying to do this:

egen inc_avg = ma(income), by(ethnicity)

Stata does not seem to allow -by- for -ma-

I also tried

egen inc_avg = ma(income), by(ethnicity) & (year)

Stata doesn't allow & in this context.

Any suggestions?

Thanks,
Steve
*
*   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   |   What's new   |   Site index