Learn R Programming

geex (version 1.1.1)

grab_design_matrix: 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, ...)

Value

a model.matrix

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

Examples

Run this code
# 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))

Run the code above in your browser using DataLab