[R] Predictions from the Segmented Package
Rolf Turner
rolf.turner at xtra.co.nz
Thu Feb 7 00:38:22 CET 2013
Since no-one else seems to have responded to your question, I'll
chip in with my two bob's worth:
(1) You can probably get what you might want to get from predict()
by looking at X$fitted.values --- where X is the object returned by
segmented().
(2) But predict() is probably the wrong way to go. You can get
the break points (or point if you have just two segments) by
looking at X$psi[,2].
You can get the slopes of the segments from slope(X). You
can get the intercepts of the segments from intercept(X).
This should give you all the information that you need. Said
he, optimistically.
HTH
cheers,
Rolf Turner
P. S. Does anyone know why or whither Vito Muggeo has disappeared?
R. T.
On 02/06/2013 11:30 AM, oli tills wrote:
> Hi,
> I would like to calculate the area under segmented regression lines (single breakpoints). I had thought that I could do this using the predict() function to ascertain some key x y values in order to determine the dimensions for two trapezoids (under each segment of my regression). However, I've not had any success with this and have just read online that the predict function does not work for segmented. Has anyone successfully done what I describe? Or is able to provide some advice on how best to approach this task?
More information about the R-help
mailing list