Confidence intervals for jumpoints in stepmented regression
confint.stepmented.RdComputes confidence intervals for the changepoints (or jumpoints) in a fitted `stepmented' model.
Usage
# S3 method for class 'stepmented'
confint(object, parm, level=0.95, method=c("delta", "score", "gradient"), <!-- %var.diff=FALSE, -->
round=TRUE, cheb=FALSE, digits=max(4, getOption("digits") - 1),
.coef=NULL, .vcov=NULL, ...)Arguments
- object
a fitted
stepmentedobject.- parm
the stepmented variable of interest. If missing the first stepmented variable in
objectis considered.- level
the confidence level required, default to 0.95.
- method
which confidence interval should be computed. One of
"delta","score", or"gradient". Can be abbreviated. Currently only"delta"allowed.- round
logical. Should the values (estimates and lower/upper limits) rounded to the smallest observed value?
- cheb
logical. If
TRUE, the confidence limits are computed using the Chebyshev inequality which yields conservative confidence intervals but it is 'robust' to the non-normality of the changepoint sampling distribution.
- digits
controls the number of digits to print when returning the output.
- .coef
The regression parameter estimates. If unspecified (i.e.
NULL), it is computed internally bycoef(object).- .vcov
The full covariance matrix of estimates. If unspecified (i.e.
NULL), the covariance matrix is computed internally byvcov(object).- ...
additional arguments passed to
vcov.stepmented, namelyk.
Details
confint.stepmented computes confidence limits for the changepoints. Currently the only option is 'delta', i.e. to compute the approximate covariance matrix via a smoothing approximation (see vcov.stepmented) and to build the limits using the standard Normal quantiles. Note that, the limits are rounded to the lowest observed value, thus the resulting confidence interval might not be symmetric if the stepmented covariate has not equispaced values.
Value
A matrix including point estimate and confidence limits of the breakpoint(s) for the
stepmented variable possibly specified in parm.
See also
stepmented and lines.segmented to plot the estimated breakpoints with corresponding
confidence intervals.
Examples
set.seed(10)
x<-1:100
z<-runif(100)
y<-2+2.5*(x>45)-1.5*(x>70)+z+rnorm(100)
o<-stepmented(y, npsi=2)
confint(o) #round=TRUE is default
#> Est. CI(95%).low CI(95%).up
#> psi1.index 47 46 48
#> psi2.index 70 68 73
confint(o, round=FALSE)
#> Est. CI(95%).low CI(95%).up
#> psi1.index 47.62909 46.39268 48.86550
#> psi2.index 70.96822 68.46782 73.46862