Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: egen mean function


From   austin nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: egen mean function
Date   Thu, 18 Aug 2005 18:16:25 -0400

I don't think James wants the prior seven days by individual, so it
seems Nick's suggestion would be the way to go if you prefer not to
use my suggestion form yesterday.

. collapse st, by(day)
. egen m7=filter(... etc.
. sort day
. save m7
. use orig_dta
. sort day
. merge day using m7

James, since you are not using the solution I proposed yesterday, I
presume you are not worried about gaps in days (i.e. missing
days==235)?

On 8/18/05, Kit Baum <baum@bc.edu> wrote:
> You need to tsset your data with both the individual and time
> indicator, e.g.
> 
> webuse grunfeld
> tsset company year
> 
> Then tssmooth will operate separately on each panel within the
> dataset (as will egen filter).

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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