predict.wbgee: Predictions and simulations from within-between GEE models

View source: R/utils.R

predict.wbgeeR Documentation

Predictions and simulations from within-between GEE models

Description

These methods facilitate fairly straightforward predictions from wbgee models.

Usage

## S3 method for class 'wbgee'
predict(
  object,
  newdata = NULL,
  type = c("link", "response"),
  se.fit = FALSE,
  raw = FALSE,
  ...
)

Arguments

object

Object of class inheriting from "lm"

newdata

An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.

type

Type of prediction (response or model term). Can be abbreviated.

se.fit

A switch indicating if standard errors are required.

raw

Is newdata a geeglm model frame or panel_data? TRUE indicates a geeglm-style newdata, with all of the extra columns created by wbgee.

...

further arguments passed to or from other methods.

Details

Panel histories and prepared rows follow the same conventions as predict.wbm(). Interaction plotting uses fixed estimation-sample reference means and the fitted GEE covariance matrix for confidence intervals.

Examples

if (requireNamespace("geepack")) {
  data("WageData")
  wages <- panel_data(WageData, id = id, wave = t)
  model <- wbgee(lwage ~ lag(union) + wks, data = wages)
  # By default, assumes you're using the processed data for newdata
  predict(model)
}

panelr documentation built on Nov. 7, 2026, 1:07 a.m.