seg | R Documentation |
Function used to define the segmented term within the segreg formula. The function simply passes relevant information to proper fitter functions.
seg(x, psi = NA, npsi = 1, est = NA, R = NA, fixed.psi = NULL, by = NULL, f.x = I)
x |
The segmented (numeric) covariate |
psi |
Possible starting value(s) for the breakpoint(s). If omitted, |
npsi |
The number of breakpoints to estimate. Default |
est |
Possible vector (of length equal to |
R |
Matrix to constrain the slopes. If provided, it overwrites the matrix coming from the specification of |
fixed.psi |
Possible fixed breakpoint values. These will be accounted for in addition to the estimated ones; |
by |
A possible factor meaning an interaction with the segmented term. It means that a different segmented relationship is fitted within each category. |
f.x |
an optional function meaning a function to apply to the covariate before fitting |
The function is used within segreg
to 'build' information about the segmented relationships to fit.
The function simply returns the covariate with added attributes relevant to segmented term
If any value is provided in fix.psi
, the corresponding slope difference coefficient will be labelled by *.fixed.*
. The slope
function will compute the 'right' slopes also accounting for the fixed breakpoints.
Vito Muggeo
segreg
##see ?segreg
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.