augment.ipd: Augment Data from an IPD Fit

View source: R/methods.R

augment.ipdR Documentation

Augment Data from an IPD Fit

Description

Augments the data used for an IPD method/model fit with additional information about each observation.

Usage

## S3 method for class 'ipd'
augment(x, data = x$data_u, ...)

Arguments

x

An object of class ipd.

data

The data.frame used to fit the model. Default is x$data.

...

Additional arguments to be passed to the augment function.

Value

A data.frame containing the original data along with fitted values and residuals.

Examples


#-- Generate Example Data

set.seed(2023)

dat <- simdat(n = c(300, 300, 300), effect = 1, sigma_Y = 1)

head(dat)

formula <- Y - f ~ X1

#-- Fit IPD

fit <- ipd(formula, method = "postpi_analytic", model = "ols",

  data = dat, label = "set_label")

#-- Augment Data

augmented_df <- augment(fit)

head(augmented_df)


ipd documentation built on April 4, 2025, 4:41 a.m.