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
Time and/or Spatial fixed SDM model estimationI am trying to make a research about determinants of local development with the SDM model. The theor…
Difference in differences with multiple interventions and multiple treatment groupsHello all, I am a new member and I appreciate all your help and comments. I am interested in evalu…
Moderation/Interaction effectHi everyone! I am running a linear regression with wage as dependent variable; education (dummy code…
Graphing change in the hazard ratios after stcox tvc() optionHi, I am using Cox proportional hazar model with time dependent variables, I want to graph how hazar…
How to interpret "interactplot" ?Hi forum! I'm studying the interaction terms of my linear multiple regression (continuous variables)…
Subscribe to:
Post Comments (Atom)
0 Response to Pseudo out-of-sample forecast using loops
Post a Comment