predict.smog
can produce the prediction for user-given new data, based on the
provided fitted model (object
) in the S3method of smog
. If the newdata
omitted,
it would output the prediction for the fitted model itself. The yielded result should
match with the family in the provided model. See smog
.
# S3 method for smog
predict(object, newdata = NULL, family = "gaussian",
...)
a fitted object of class inheriting from smog.
a data frame containing the predictor variables, which are used to predict. If omitted, the fitted linear predictors are used.
a description of distribution family for which the response variable is to be predicted.
additional arguments affecting the predictions produced.
If family
= "gaussian", a vector of prediction for the response is returned.
For family
= "coxph", a vector of predicted risk score is returned.
When family
= ''binomial'', it outputs a data frame containing the predicted
group labels and the corresponding probabilies.
If newdata = NULL
, the fitted.value based on the object
is used for the prediction. For family = "coxph", the returned prediction value
is the risk score.
ma2019structuralsmog