predict.varmod {earth} | R Documentation |
Predict with a varmod model
Description
You probably won't need to call this function directly.
It is called by predict.earth
when that function's interval
argument is used.
Usage
## S3 method for class 'varmod'
predict(
object = stop("no 'object' argument"),
newdata = NULL,
type = c("pint", "cint", "se", "abs.residual"),
level = .95,
trace = FALSE,
...)
Arguments
object |
A |
newdata |
Make predictions using |
type |
Type of prediction. This is the |
level |
Confidence level for the |
trace |
Currently unused. |
... |
Unused, but provided for generic/method consistency. |
Note
predict.varmod
is called by predict.earth
when its interval
argument is used.
See Also
Examples
data(ozone1)
set.seed(1) # optional, for cross validation reproducibility
# note: should really use ncross=30 below but for a quick demo we don't
earth.mod <- earth(O3~temp, data=ozone1, nfold=10, ncross=3, varmod.method="lm")
# call predict.earth, which calls predict.varmod
predict(earth.mod, newdata=ozone1[200:203,], interval="pint", level=.95)