Sorry, figured it out . This is the correct format.
egen inc_avg = ma(income), by(ethnicity year)
On Mon, Aug 17, 2009 at 1:27 PM, Steven Archambault<[email protected]> wrote:
> 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/