Confidence intervals for breakpoints
confint.segmented.RdComputes confidence intervals for the breakpoints in a fitted `segmented' model.
Arguments
- object
a fitted
segmentedobject.- parm
the segmented variable of interest. If missing the first segmented 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.- rev.sgn
vector of logicals. The length should be equal to the length of
parm; recycled otherwise. whenTRUEit is assumed that the currentparmis `minus' the actual segmented variable, therefore the sign is reversed before printing. This is useful when a null-constraint has been set on the last slope.- var.diff
logical. If
method="delta", and there is a single segmented variable,var.diff=TRUEleads to standard errors based on sandwich-type formula of the covariance matrix. See Details insummary.segmented.- is
logical. If
method="delta",is=TRUEmeans that the full covariance matrix is computed viavcov(.., is=TRUE)- 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 parameters referring to Score-based confidence intervals, such as
"h","d.h","bw","msgWarn", and"n.values"specifying the number of points used to profile the Score (or Gradient) statistic.
Details
confint.segmented computes confidence limits for the breakpoints. Currently there are three options, see argument method.
method="delta" uses the standard error coming from the Delta
method for the ratio of two random variables. This value is an approximation (slightly) better than the
one reported in the `psi' component of the list returned by any segmented method. The resulting
confidence intervals are based on the asymptotic Normal distribution of the breakpoint
estimator which is reliable just for clear-cut kink relationships. See Details in segmented. method="score" or method="gradient" compute the
confidence interval via profiling the Score or the Gradient statistics smoothed out by the induced smoothing paradigm, as discussed in the reference below.
Value
A matrix including point estimate and confidence limits of the breakpoint(s) for the
segmented variable possibly specified in parm.
References
Muggeo, V.M.R. (2017) Interval estimation for the breakpoint in segmented regression: a smoothed score-based approach. Australian & New Zealand Journal of Statistics 59, 311–322.
Note
Currently method="score" or method="gradient" only works for segmented linear model. For segmented generalized linear model, currently only method="delta" is available.
See also
segmented and lines.segmented to plot the estimated breakpoints with corresponding
confidence intervals.
Examples
set.seed(10)
x<-1:100
z<-runif(100)
y<-2+1.5*pmax(x-35,0)-1.5*pmax(x-70,0)+10*pmax(z-.5,0)+rnorm(100,0,2)
out.lm<-lm(y~x)
o<-segmented(out.lm,seg.Z=~x+z,psi=list(x=c(30,60),z=.4))
confint(o) #delta CI for the 1st variable
#> Warning: There are multiple segmented terms. The first is taken
#> Est. CI(95%).low CI(95%).up
#> psi1.z 0.606068 0.518448 0.693689
confint(o, "x", method="score") #also method="g"
#> Est. CI(95%).low CI(95%).up
#> psi1.x 34.7459 33.3440 36.1810
#> psi2.x 69.0247 68.0892 70.0797