RealInt             package:strucchange             R Documentation

_U_S _E_x-_p_o_s_t _R_e_a_l _I_n_t_e_r_e_s_t _R_a_t_e

_D_e_s_c_r_i_p_t_i_o_n:

     US ex-post real interest rate: the three-month treasury bill
     deflated by the CPI inflation rate.

_U_s_a_g_e:

     data(RealInt)

_F_o_r_m_a_t:

     A quarterly time series from 1961(1) to 1986(3).

_S_o_u_r_c_e:

     The data is available online in the data archive of the Journal of
     Applied Econometrics <URL:
     http://qed.econ.queensu.ca/jae/2003-v18.1/bai-perron/>.

_R_e_f_e_r_e_n_c_e_s:

     Bai J., Perron P. (2003), Computation and Analysis of Multiple
     Structural Change Models, _Journal of Applied Econometrics_, *18*,
     1-22.

_E_x_a_m_p_l_e_s:

     if("package:sandwich" %in% search() || require(sandwich)) {

     ## load and plot data
     data(RealInt)
     plot(RealInt)

     ## estimate breakpoints
     bp.ri <- breakpoints(RealInt ~ 1, h = 15)
     plot(bp.ri)
     summary(bp.ri)

     ## fit segmented model with three breaks
     fac.ri <- breakfactor(bp.ri, breaks = 3, label = "seg")
     fm.ri <- lm(RealInt ~ 0 + fac.ri)
     summary(fm.ri)

     ## setup kernel HAC estimator
     vcov.ri <- function(x, ...) kernHAC(x, kernel = "Quadratic Spectral",
       prewhite = 1, approx = "AR(1)", ...)

     ## Results from Table 1 in Bai & Perron (2003):
     ## coefficient estimates
     coef(bp.ri, breaks = 3)
     ## corresponding standard errors
     sapply(vcov(bp.ri, breaks = 3, vcov = vcov.ri), sqrt)
     ## breakpoints and confidence intervals
     confint(bp.ri, breaks = 3, vcov = vcov.ri)

     ## Visualization
     plot(RealInt)
     lines(fitted(fm.ri), col = 4)
     lines(confint(bp.ri, breaks = 3, vcov = vcov.ri))
     }

