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

View source: R/predict.R

predict.cat_glmR Documentation

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 class 'cat_glm'
predict(object, newdata = NULL, ...)

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.

Value

A vector of predicted values for the specified new data.


catalytic documentation built on April 4, 2025, 5:51 a.m.