Learn R Programming

scar (version 0.2-2)

predict.scair: Predict method for scair fits

Description

This function obtains predictions from a fitted scair object.

Usage

# S3 method for scair
predict(object, newdata, type = c("link", "response"), rule=1, ...)

Arguments

object

A fitted scair object produced by scair.

newdata

An optional numeric matrix of \(d\) columns, with each row specifying a location at which prediction is required. This argument can be missing, in which case predictions are made at the same values of the covariates used to compute the object.

type

Type of predictions, with choices "link" (the default), or "response". The default produces predictions on the scale of the index predictors. If "response" is selected, the predictions are on the scale of the response (i.e. mean of the exponential family), and are monotone transformations of the index predictors using the inverse link function.

rule

An integer describing how to handle the new data outside the range of the observed indices (computed via linear combination of observed covariates). If rule=1, then we use linear interpolation to get the value of each fitted component function outside the range of observed covariates. Otherwise if rule=2, then the value at the closest data extreme is used. Note that if there is convex/concave component, the choice of the first rule can lead to somewhat unsatifactary performance on/outside the "boundary" of the data (when comparing to the second rule).

...

Further arguments passed to or from other methods.

Value

A numeric vector of predictions.

See Also

scair, plot.scair, predict.scar

Examples

Run this code
# NOT RUN {
## See examples for the function scair
# }

Run the code above in your browser using DataLab