ancova_contrast_design: Build the ANCOVA contrast design matrix

View source: R/ancova.R

ancova_contrast_designR Documentation

Build the ANCOVA contrast design matrix

Description

Creates one complete model-matrix row per treatment-group level. Numeric covariates are set to their means in data, excluding missing values, logical covariates to FALSE, and factor covariates to their first level. The fitted model's contrast coding is retained so that differences between rows include all required interaction coefficients. Means are calculated on the raw covariate scale before applying formula transformations, using all non-missing values in the supplied visit data.

Usage

ancova_contrast_design(model, data, outcome)

Arguments

model

A fitted lm model containing the internal rbmiGroup factor.

data

The raw model data used to fit model, including the untransformed predictor columns required to evaluate transformed terms.

outcome

Character, the outcome variable name.

Value

A numeric model matrix with one row per rbmiGroup level.


rbmi documentation built on Oct. 15, 2026, 9:06 a.m.