ranef_model_matrix: Create a random effect incidence matrix

Description Usage Arguments Value

View source: R/create_model_matrices.R


Creates an incidence matrix for the random effects of a mixed-model


ranef_model_matrix(random, data, vcov, sparse = TRUE)



A formula specifying the the random effect terms of the linear mixed-model. Must be preceded by a ~ and can include the modifier verbs at[sommer], us[sommer], and diag[base] to specify different structures. If a random effect term has an accompanying variance-covariance matrix (see vcov), the term should be nested using the function g[sommer]


A data.frame that includes the response and random effect predictors. If not supplied, the function will look in the current running environment.


A named list of variance-covariance matrices that correspond to the random effect terms that are specified with the sommer function. If not passed, an identity matrix is supplied.


A nested list of model matrices and variance-covariance matrices. For each random effect term, the incidence matrix Z is returned along with its accompanying variance-covariance matrix K.

neyhartj/gws documentation built on Nov. 9, 2017, 8:35 p.m.