## pretty prompt options(prompt = "R> ") ## load packages and data subset library(strucchange) data(PhillipsCurve) uk <- window(PhillipsCurve, start = 1948) ## plot data plot(uk[, "dp"]) ## estimate breakpoints bp.pc <- breakpoints(dw ~ dp1 + du + u1, data = uk, h = 5, breaks = 5) ## look at RSS and BIC plot(bp.pc) summary(bp.pc) ## fit partially segmented model with two breaks fac.pc <- breakfactor(bp.pc, breaks = 2, label = "seg") fm.pc <- lm(dw ~ 0 + fac.pc/dp1 + du + u1, data = uk) summary(fm.pc) ## Table 3: ## coefficient estimates coef(fm.pc) ## corresponding standard errors sqrt(diag(vcov(fm.pc))) ## breakpoints and confidence intervals confint(bp.pc, breaks = 2, het.err = FALSE)