Hello, I have tried running a code given to me to predict a pseudo out-of-sample forecast using a loop of autoregression, but I only get syntax error. I suspect I must download an extension or something, but I'm not sure. I would appreciate any help!
Here's my code:
local start = tq(2003q1)
local end = tq(2012q4)
gen forecast = .
forvalues i = `start'/`end' {
* AR(2) regression ;
reg d_infl L(1/2).d_infl if quarter >= tq(1963q1) & quarter <=`i', robust
* forecast for the next period ;
replace forecast = _b[_cons] + _b[L1.d_infl]*L1.d_infl+ _b[L2.d_infl]*L2.d_infl if quarter == `i' + 1 ;
}
Related Posts with Pseudo out-of-sample forecast using loops
transparency in points on graphHi, I know there is an option to add transparency to data on a scatter plot in stata 15 but is it p…
Why different FE and RE results for the same model ? One uses eststoHi All, I'm using STATA 15. My problem is that I see different results when I run the same random-…
Markstat - pdf headers and syntax highlightingHi all, Coming from an R/python background, I have been enjoying playing with German Rodriguez exce…
How to report 95% CI of random-intercept in mixed effects model?Hi All, I'm using STATA 15. My question: Would someone know how to report the 95% confidence inter…
Calculating Average pay gapHello, I wanted to calculate the average pay gap between workers in my data set. How do i do that? …
Subscribe to:
Post Comments (Atom)
0 Response to Pseudo out-of-sample forecast using loops
Post a Comment