Learn R Programming

segmented (version 0.2-3)

slope: Slope estimates from segmented relationships

Description

Computes slopes of each `segmented' relationship in the fitted model.

Usage

slope(ogg, conf.level = 0.95)

Arguments

ogg
an object of class "segmented", returned by any segmented method.
conf.level
the confidence level required.

Value

  • slope returns a list of matrices. Each matrix represents a segmented relationship and its number of rows equal to the number of segments, while five columns summarize the results.

Details

To fit broken-line relationships, segmented uses a parameterization whose coefficients are not the slopes. Therefore given an object "segmented", slope computes point estimates, standard errors, t-values and confidence intervals of the slopes of each segmented relationship in the fitted model.

References

Muggeo, V.M.R. (2003) Estimating regression models with unknown break-points. Statistics in Medicine 22, 3055--3071.

See Also

See also davies.test to test for a nonzero differece-in-slope parameter.

Examples

Run this code
set.seed(16)
x<-1:100
y<-2+1.5*pmax(x-35,0)-1.5*pmax(x-70,0)+rnorm(100,0,3)
out<-glm(y~1)
out.seg<-segmented(out,seg.Z=~x,psi=list(x=c(20,80)))
## the slopes of the three segments....
slope(out.seg)
rm(x,y,out,out.seg)

Run the code above in your browser using DataLab