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 <- as.Date(data.df[,1]) selection<-which(dates>=as.Date("1986-1-1") & dates<=as.Date("2007-12-31")) dep <- ts(data.df[selection,c("dep")]) indep.ret1 <- ts(data.df[selection,c("RET1")]) indep.ret2 <- ts(data.df[selection,c("RET2")]) indep.ret3 <- ts(data.df[selection,c("RET3")]) indep.ret4 <- ts(data.df[selection,c("RET4")]) indep.ret5 <- ts(data.df[selection,c("RET5")]) d<-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 <- 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<-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@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.