ranef_model_matrix: Create a random effect incidence matrix

View source: R/deprecated_functions.R

ranef_model_matrixR Documentation

Create a random effect incidence matrix

Description

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

Usage

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

Arguments

random

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]

data

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

vcov

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.

Value

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 Feb. 5, 2024, 12:42 a.m.