model.matrix.egf {epigrowthfit}R Documentation

Extract Design Matrices

Description

Extracts from a model object fixed and random effects design matrices.

Usage

## S3 method for class 'egf'
model.matrix(object, which = c("fixed", "random"),
             top = NULL, random = NULL, ...)

Arguments

object

an egf object.

which

a character string controlling what is returned:

"fixed"

the fixed effects design matrix X corresponding to top.

"random"

the random effects design matrix Z corresponding to top and random.

top

a character string specifying a top level nonlinear model parameter. NULL indicates “all of them”; see ‘Details’.

random

a random effect term, which is a call to binary operator |. NULL indicates “all of them”; see ‘Details’.

...

unused optional arguments.

Details

model.matrix(which = "fixed", top = NULL) returns the result of combining (in the sense of cbind) all fixed effects design matrices.

model.matrix(which = "random", top = "<name>", random = NULL) returns the result of combining all random effects design matrices associated with parameter top.

model.matrix(which = "random", top = NULL, random = NULL) returns the result of combining all random effects design matrices and permuting the columns to obtain a convenient ordering of random effect coefficients. (Coefficients are sorted by relation to a common random vector. Random vectors are sorted by relation to a common covariance matrix.)

None of these “combined” design matrices possesses attributes assign and contrasts.

Value

A (sparse) dgCMatrix or a traditional (dense) matrix, with attributes assign and contrasts except in special cases; see ‘Details’.

See Also

The generic function model.matrix.


[Package epigrowthfit version 0.15.3 Index]