model.matrix.lmm | R Documentation |
Extract or construct design matrices for a linear mixed model.
## S3 method for class 'lmm'
model.matrix(
object,
newdata = NULL,
effects = "mean",
simplify = TRUE,
drop.X = NULL,
na.rm = TRUE,
...
)
object |
an |
newdata |
[data.frame] dataset relative to which the design matrix should be constructed. |
effects |
[character] design matrix relative to the mean model ( |
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. |
When simplify
is FALSE
, a list with the followin elements:
mean
: design matrix for the mean model
Y
: vector of outcome values
vcov
: list of elements for the variance and correlation models.
index.cluster
: list containing, for each cluster, the location of the corresponding observations in the processed dataset.
index.clusterTime
: list containing, for each cluster, the repetition index corresponding observations.
index.clusterStrata
: list containing, for each cluster, the strata index corresponding observations.
param
: data.frame describing the modle parameters.
drop.X
: logical value indicating whether columns in the design matrix should be dropped if it has not full rank.
precompute.XX
, precompute.XY
: moments of X and Y
When simplify
is TRUE
, this list will be simplified into a list with three elements:
mean
: design matrix for the mean model
variance
: design matrix for the variance model
correlation
: design matrix for the correlation model
or a single design matrixx.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.