Displaying 1 result from an estimated 1 matches for "twolag".
Did you mean:
twolame
2010 May 06
1
question about rolling regressions
...eries objects and compute first
differences:
vad <- ts(data$ALLGVA/data$GDPDEF, start=1948, frequency=1)
emp <- ts(data$ALLEMP, start=1948, frequency=1)
vad.dif1 <- diff(vad)
emp.dif1 <- diff(emp)
(2) I make a data set:
d <-
ts.union(emp.chng=emp.dif1,lag.emp.chng=lag(emp.dif1,-1),twolag.emp.chng=lag(emp.dif1,-2),
vad.chng=vad.dif1,lag.vad.chng=lag(vad.dif1,-1),twolag.vad.chng=lag(vad.dif1,-2))
(3) I run regressions:
reg2 <- lm(emp.chng~vad.chng+lag.vad.chng+lag.emp.chng, data=d)
What I would like to do is to run this regression with a 10 year moving
window. So, the first re...