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

Re: st: egen mean function

From   austin nichols <>
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

On 8/18/05, Kit Baum <> 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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index