Learn R Programming

catalytic (version 0.1.0)

predict.cat_glm: Predict Outcome for New Data Using a Fitted GLM Model

Description

This function generates predictions for new data points based on a fitted categorical Generalized Linear Model (GLM) object. Depending on the type of model, it either uses stats::predict.glm or calculates predictions based on the model coefficients.

Usage

# S3 method for cat_glm
predict(object, newdata = NULL, ...)

Value

A vector of predicted values for the specified new data.

Arguments

object

A fitted model object of class cat_glm, containing the GLM fit and model details.

newdata

An optional data frame containing new predictor values. If NULL, the function uses the observation data from the model's initialization object.

...

Additional arguments passed to stats::predict.glm, if applicable. User should input type = c("link", "response", "terms") for different regression models.