predictGLM: Prediction Intervals for Log-Link and Logit-Link Generalised...

View source: R/predictGLM.R

predictGLMR Documentation

Prediction Intervals for Log-Link and Logit-Link Generalised Linear Models

Description

Teaching helper for predictions from log-link and logit-link generalised linear models. It wraps predict.glm with standard errors and returns fitted values with confidence limits on either the link scale or the response scale.

Usage

predictGLM(object, newdata, type = "link", cilevel = 0.95, quasit = FALSE, ...)

Arguments

object

a glm object, i.e. the output from glm.

newdata

prediction data frame.

type

"link" (default) or "response" for estimates and confidence intervals on the linear predictor or response scale.

cilevel

confidence level for the intervals.

quasit

if TRUE, use a t multiplier rather than a normal multiplier for confidence intervals when object is a quasi model.

...

optional arguments that are passed to predict.glm.

Details

This is not an S3 predict() method and is not intended to be a drop-in replacement for base R prediction methods. It is the more general GLM teaching helper in this package; predictCount remains a specialised count-focused wrapper with rounded response-scale output.

Note: newdata must include all first-order terms used in the fitted model. This simplified requirement reflects the teaching-wrapper interface and is not a complete reproduction of predict.glm().

Value

A data frame with columns fit, lwr, and upr containing fitted values and confidence limits on the requested scale.

See Also

predict, predict.glm, predictCount.


s20x documentation built on July 1, 2026, 9:06 a.m.