grab_design_matrix: Grab a matrix of fixed effects from a model object

View source: R/grab_funs.R

grab_design_matrixR Documentation

Grab a matrix of fixed effects from a model object

Description

Grab a matrix of fixed effects from a model object

Usage

grab_design_matrix(data, rhs_formula, ...)

Arguments

data

the data from which to extract the matrix

rhs_formula

the right hand side of a model formula

...

Can be used to pass xlev to model.frame

Value

a model.matrix

Examples

# Create a "desigm" matrix for the first ten rows of iris data
fit <- lm(Sepal.Width ~ Petal.Width, data = iris)
grab_design_matrix(
  data = iris[1:10, ],
  grab_fixed_formula(fit))

geex documentation built on Aug. 8, 2022, 5:05 p.m.