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

st: [Stata 9] -rolling-


From   Cameron Hooper <chooper@umich.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: [Stata 9] -rolling-
Date   Mon, 9 May 2005 13:19:21 -0400

I don't have Stata 9 but from a post to this list I note that version 9 has a -rolling- command. Can this new command perform rolling OLS regressions? If so, will it allow gaps in the data series? I've been using the excellent -rollreg- module, but it does not allow gaps. Here is some test data to illustrate my question (using version 8.2)

. clear
. use http://www-personal.umich.edu/~chooper/stata/rrtest2
. list if id == 1

+----------------------------+
| id y x1 x2 year |
|----------------------------|
1. | 1 12 80 100 1980 |
2. | 1 23 90 93 1981 |
3. | 1 45 100 62 1982 |
4. | 1 13 56 120 1983 |
5. | 1 22 65 90 1984 |
|----------------------------|
6. | 1 21 . 80 1985 |
7. | 1 56 120 12 1986 |
8. | 1 43 90 45 1987 |
9. | 1 29 67 67 1988 |
10. | 1 14 42 55 1989 |
+----------------------------+

. tsset id year
panel variable: id, 1 to 2
time variable: year, 1980 to 1995

. rollreg y x1 x2, move(5) stub(rr)

Number of gaps in sample: 1

Observations with preceding time gaps
----------------------------------
Record | id year
----------+-----------------------
7 | 1 1986
----------------------------------
sample may not contain gaps
r(198);

end of do-file
r(198);

Cheers,

Cameron

*
* 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