[R] How to account for autoregressive terms?

From: Daphne Renault <daphne.renault_at_yahoo.com>
Date: Thu, 22 May 2008 01:39:23 -0700 (PDT)


Hi,

how to estimate a the following model in R:

y(t)=beta0+beta1*x1(t)+beta2*x2(t)+...+beta5*x5(t)+beta6*y(t-1)+beta7*y(t-2)+beta8*y(t-3)

  1. using "lm" : dates &lt;- as.Date(data.df[,1]) selection&lt;-which(dates&gt;=as.Date("1986-1-1") &amp; dates&lt;=as.Date("2007-12-31")) dep &lt;- ts(data.df[selection,c("dep")]) indep.ret1 &lt;- ts(data.df[selection,c("RET1")]) indep.ret2 &lt;- ts(data.df[selection,c("RET2")]) indep.ret3 &lt;- ts(data.df[selection,c("RET3")]) indep.ret4 &lt;- ts(data.df[selection,c("RET4")]) indep.ret5 &lt;- ts(data.df[selection,c("RET5")]) d&lt;-ts.union(dep,indep.ret1,indep.ret2,indep.ret3,indep.ret4,indep.ret5,dep.lag1=lag(dep,-1),dep.lag2=lag(dep,-2),dep.lag3=lag(dep,-3)) fit1 &lt;- lm(dep~indep.ret1+indep.ret2+indep.ret3+indep.ret4+indep.ret5+dep.lag1+dep.lag2+dep.lag3,data=d) summary(fit1) #coeftest(fit1,vcov=NeweyWest)
  2. using armaFit: fit2&lt;-armaFit(dep~ar(3),xreg=ts(data.df[selection,c("RET1","RET2","RET3","RET4","RET5")]),data=ts(data.df[selection,-1])) summary(fit2)

The results of 1) and 2) are completely different. Does anybody have an explanation for this?

The dependent and some independent variables are autocorrelated because of overlapping observations (but do not posess a unit root). Therefore I have added lagged dependent variables as additional regressors to resolve the problem of autocorrelation in the dependent variables. To account for residual autocorrelation in the residuals I want to use the procedure of Newey West. Is this idea absolute nonsense?

Kind regards,
Daphne

      
	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 22 May 2008 - 09:51:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 22 May 2008 - 12:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive