Predict method for stepmented model fits
predict.stepmented.RdReturns predictions and optionally associated quantities (standard errors or confidence intervals) from a fitted stepmented model object.
Arguments
- object
a fitted stepmented model coming from
stepmented.lmorstepmented.glm.- newdata
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.
- se.fit
Logical. Should the standard errors be returned?
- interval
Which interval? See
predict.lm- type
Predictions on the link or response scale? Only if
objectis a stepmented glm.- na.action
How to deal with missing data, if
newdatainclude them.- level
The confidence level.
- .coef
The regression parameter estimates. If unspecified (i.e.
NULL), it is computed internally bycoef().- .vcov
The estimate covariance matrix. If unspecified (i.e.
NULL), it is computed internally byvcov.stepmented().- apprx.fit
The approximation of the \((x>\hat\psi)\) used to compute the predictions/fitted values of the piece-wise relationships.
- apprx.se
The same abovementioned approximation to compute the standard error.
- ...
further arguments, for instance
kto be passed tovcov.stepmented.
Details
Basically predict.stepmented builds the right design matrix accounting for breakpoint and passes it
to predict.lm or predict.glm depending on the actual model fit object.
Value
predict.stepmented produces a vector of predictions with possibly associated standard errors or confidence intervals.
See predict.lm, predict.glm, or predict.segmented.
Warning
For stepmented glm fits with offset, predict.stepmented returns the fitted values including the offset.