Learn R Programming

pda (version 1.3.0)

make_patterns: Construct binary covariate pattern matrix

Description

Builds the full design grid of binary fixed-effect patterns used by COLA to aggregate counts and outcome sums. When `intercept = TRUE`, an `Intercept` column of ones is included and all other variables are expanded over {0,1}.

Usage

make_patterns(x_names, intercept = TRUE)

Value

A tibble of all binary patterns over `x_names` (with/without `Intercept`), one row per pattern.

Arguments

x_names

Character vector of fixed-effect names. If `intercept = TRUE`, it may include `"Intercept"`; otherwise it must not.

intercept

Logical; include a fixed intercept column. Default: `TRUE`.