model.matrix.lmm {LMMstar}R Documentation

Design Matrix for Linear Mixed Model

Description

Extract or construct design matrices for Linear Mixed Model.

Usage

## S3 method for class 'lmm'
model.matrix(
  object,
  newdata = NULL,
  effects = "mean",
  simplify = TRUE,
  drop.X = NULL,
  na.rm = TRUE,
  ...
)

Arguments

object

an lmm object

newdata

[data.frame] dataset relative to which the design matrix should be constructed.

effects

[character] design matrix relative to the mean model ("mean"), variance model ("variance"), correlation model ("correlation"), or all the previous ("all"). Can also be "index" to only output the normalize data and the cluster, time, strata indexes.

simplify

[logical] simplify the data format of the output (matrix instead of a list of matrix) when possible.

drop.X

[logical] when the design matrix does not have full rank, should columns be dropped?

na.rm

[logical] Should row containing missing values for the variables used in the linear mixed model be removed?

...

Not used. For compatibility with the generic method.

Value

When simplify is FALSE, a list with the followin elements:

When simplify is TRUE, this list will be simplified into a list with three elements:

or a single design matrixx.


[Package LMMstar version 1.1.0 Index]