slope.segmented {segmented} | R Documentation |
Computes summary of the slopes of each segmented relationship in the fitted model.
slope.segmented(ogg, level = 0.95)
ogg |
an object of class "segmented" , returned by any segmented method. |
level |
the confidence level required. |
To fit broken-line relationships, segmented
uses a parameterization whose coefficients are not
the slopes. Therefore given an object "segmented"
, slope.segmented
computes point estimates,
standard errors, t-values and confidence intervals of the slopes of each segmented
relationship in the fitted model.
slope.segmented
returns a list for each variable having a piecewise-linear relation
with the response in the fitted model. Each list is a matrix with number of rows equal to number of
segments and five columns summarizing the results.
The returned summary is based on limiting Gaussian distribution for the model parameters involved
in the computations. Sometimes even with large sample sizes such approximations are questionable
(e.g., with small difference-in-slopes parameters) and the results returned by slope.segmented
might be unreliable. Therefore is responsability of the user to gauge the applicability of such asymptotic
approximations. Anyway, the t values may be not assumed for testing purposes
and they should be used just as guidelines to assess the estimates' uncertainty.
Vito M. R. Muggeo, vito.muggeo@giustizia.it
Muggeo, V.M.R. (2003) Estimating regression models with unknown break-points. Statistics in Medicine 22, 3055–3071.
## A segmented relationship with three breakpoints ## x<-1:100 y<-2+1.5*pmax(x-35,0)-1.5*pmax(x-70,0)+rnorm(100,0,5) dati<-data.frame(x=x,y=y) out.lm<-lm(y~x,data=dati) out.seg<-segmented(out.lm,Z=x,psi=c(20,80)) ## the slopes of the three segments.... slope.segmented(out.seg) rm(x,y,out.lm,out.seg)