Obtains predictions from a fitted addreg
object.
# S3 method for addreg
predict(object, newdata = NULL, type = c("link", "response", "terms"), terms = NULL,
na.action = na.pass, checkminmax = TRUE, ...)
a fitted object of class inheriting from "addreg"
.
optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.
the type of prediction required. The default is on the scale of the linear predictors;
the alternative "response"
is on the scale of the response variable.
The "terms"
option returns a matrix giving the fitted values of each term in the
model formula on the linear predictor scale.
The value of this argument can be abbreviated.
with type = "terms"
by default all terms are returned.
A character vector specifies which terms are to be returned.
function determining what should be done with missing values in newdata
.
The default is to predict NA
.
logical indicating whether or not values of continuous covariates in newdata
should be checked to ensure they lie within the covariate space associated with the
fitted model. Otherwise predicted values could lie outside the
parameter space.
further arguments passed to or from other methods.
A vector or matrix of predictions. For type = "terms"
, this is a matrix with
a column per term, and may have an attribute "constant"
.
If newdata
is omitted the predictions are based on the data used for the fit.
In that case how cases with missing values in the original fit are treated is determined by the
na.action
argument of that fit. If na.action = na.omit
, omitted cases
will not appear in the residuals; if na.action = na.exclude
they will
appear, with residual value NA
. See also napredict
.
predict.glm
for the equivalent method for models fit using glm
.
# NOT RUN {
## For an example, see example(addreg)
# }
Run the code above in your browser using DataLab