[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: rolling calendar ests
You should be able to do this with mvsumm if you tsset correctly, e.g.
generate a sequential date variable that counts the number of trading
days, and then use that variable (and your firm indicator) in tsset.
Stata does not really understand business-daily data, so you have to
create a fake time variable that counts trading days.
Kit Baum, Boston College Economics
On Mar 23, 2005, at 2:33 AM, Yvonne wrote:
However, if I wish to do a rolling estimate giving the standard
the last actual rather than calendar year (e.g. if today is 22 March I
the standard deviation from 22 Mar 04 to 21 Mar 05, not from 1 Jan 04
Dec 05), is there an easy way to do that? If I know there are 252
days per year, can I just ask it to calculate the std dev of the last
options? I'd like to do something like
egen sigma = sd(ret[_n-252]:ret[_n-1]) if firm[_n-252] == firm[_n]
but it doesn't seem to allow anything like that.
* For searches and help try: