[R-SIG-Finance] Frage uber package strucchange
Matthieu Stigler
stigler3 at etu.unige.ch
Sun Mar 2 17:22:52 CET 2008
Hello
I'm using the nice package strucchange to see whether there is a
structural change in a regression, and especially, if the change is in
the slope or intercept coefficient.
The "Vignette" with the package (see fig 4 page 8) gives an example to
obtain a plot of the empirical process for each coefficient. However, I
don't obtain it, even with the code given in example...
Do you have also only one plot? Do you see what I do wrong, and how I
could obtain the same plot as in example?
Thanks a lot!!
The code in example is:
library("strucchange")
data("USIncExp")
USIncExp2 <- window(USIncExp, start = c(1985, 12))
coint.res <- residuals(lm(expenditure ~ income, data = USIncExp2))
coint.res <- lag(ts(coint.res, start = c(1985, 12), freq = 12),
k = -1)
USIncExp2 <- cbind(USIncExp2, diff(USIncExp2), coint.res)
USIncExp2 <- window(USIncExp2, start = c(1986, 1), end = c(2001,
2))
colnames(USIncExp2) <- c("income", "expenditure", "diff.income",
"diff.expenditure", "coint.res")
ecm.model <- diff.expenditure ~ coint.res + diff.income
me <- efp(ecm.model, type = "ME", data = USIncExp2, h = 0.2)
plot(me, functional = NULL)
More information about the R-SIG-Finance
mailing list