Displaying 1 result from an estimated 1 matches for "lm_ex32".
2011 Jun 08
1
Autocorrelation in R
...ifying a AR(1) model. Would anyone help me with my code?
Thanks in advance!
Reproducible code follows:
download.file("https://sites.google.com/a/proxima.adm.br/main/ex_32.csv
--no-check-certificate", "ex_32.csv", method="wget")
ex32=read.csv("ex_32.csv")
lm_ex32=lm(gc ~ yd, data=ex32)
summary(lm_ex32)
# Durbin-Watson (slide 26)
library(lmtest)
dwtest(gc ~ yd, data=ex32)
# or
dwtest(lm_ex32)
# Breusch-Godfrey
bgtest(lm_ex32, order=2)
# AR(1)
# In e-views, the specification was:
# GC = YD AR(1)
# and the output was:
# Dependent Variable: GC
# Method:...