a data frame containing the values at which predictions are required.
If this argument is missing, predictions are made at
the same values used to compute the object.
Only those predictors referred to in the right side of the formula in
object need be present by name in newdata.
type:
type of predictions, with choices "link" (the default), "response", or "terms".
The default produces predictions on the scale of the additive
predictors, and with newdata missing, predict() is simply an
extractor function for this component of a glm object. If
"response" is selected, the predictions are on the scale of the
response, and are monotone transformations of the additive predictors,
using the inverse link function. If type="terms" is selected, a
matrix of predictions is produced, one column for each term in the model.
se.fit:
if TRUE, pointwise standard errors are computed along with the predictions.
terms:
if type="terms", the terms= argument can be used to specify which terms should be included; the default is labels(object).
VALUE:
a vector or matrix of predictions, or a list consisting of the predictions and their standard errors if se.fit = T.
If type="terms", a matrix of fitted terms is produced, with one column for each term in the model (or subset of these if the terms= argument is used). There is no column for the intercept, if present in the model, and each of the terms is centered so that their average over the original data is zero.
The matrix of fitted terms has a "constant" attribute which, when added to the sum of these centered terms, gives the additive predictor.
DETAILS:
This function is a method for the generic function
predict
for class
"glm".
It can be invoked by calling
predict
for an object of the appropriate class, or directly by calling
predict.glm
regardless of the class of the object.
WARNING:
predict.glm can produce incorrect predictions when the newdata
argument is used if the formula in object involves
data-dependent
transformations, such as poly(Age, 3) or sqrt(Age - min(Age)).
To overcome this for glm objects, use the predict.gam method explicitly.