Learn R Programming

smog (version 2.1.0)

predict.smog: predict method for objects of the class smog

Description

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.

Usage

# S3 method for smog
predict(object, newdata = NULL, family = "gaussian",
  ...)

Arguments

object

a fitted object of class inheriting from smog.

newdata

a data frame containing the predictor variables, which are used to predict. If omitted, the fitted linear predictors are used.

family

a description of distribution family for which the response variable is to be predicted.

...

additional arguments affecting the predictions produced.

Value

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.

Details

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.

References

ma2019structuralsmog

See Also

smog.default, smog.formula, cv.smog, plot.smog.