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,
  se.fit = FALSE,
  raw = FALSE,
  type = c("link", "response"),
  ...
)

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.

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.

type

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

...

further arguments passed to or from other methods.

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 Aug. 22, 2023, 5:08 p.m.