make_design: Make design matrix from lme4 formula

Description Usage Arguments Value

View source: R/make_design.R

Description

make_design generates a design-matrix and grouping vector from a formula representing fixed and random effects

Usage

1
make_design(formula, data, random_spline = FALSE, ...)

Arguments

formula

formula using lme4 style, e.g., ~ 1 + (0+SST|group) for a random-slope model

data

data-frame used to parse the formula

random_spline

Boolean indicating whether to treat basis-spline coefficients as a grouping factor

...

additional arguments passed to model.frame

Value

Tagged-list of containing a design-matrix X_ij and the grouping variable Group_j where Group_j[X]=NA indicates that column X of X_ij corresponds to a fixed effect, whereas Group_j[X] having a positive integer indicates that column X is associated with that group of random effects.


James-Thorson/utilities documentation built on Feb. 6, 2022, 2:35 p.m.