getMat: Extract a Specific Matrix from a 'VCA' Object

View source: R/utils.R

getMatR Documentation

Extract a Specific Matrix from a 'VCA' Object

Description

For convenience only, extracting a specific matrix from the "Matrices" element of a 'VCA' object if this matrix exists.

Usage

getMat(obj, mat)

Arguments

obj

... (VCA) object

mat

... (character) string specifying the matrix to be extracted

Details

When 'mat="Z"' the design matrix of random effects will be returned. If one is interested in the design matrix of random effects for a specific variance component use a name like "Z" + NAME, where NAME has to be equal to the name of the VC in the 'VCA' object (see examples). The same applies to the A-matrices in the quadratic forms, use "A" + NAME for extracting a specific A-matrix.

Value

(matrix) as requested by the user

Examples

## Not run: 
data(dataEP05A2_1)
fit <- anovaVCA(y~day/run, dataEP05A2_1)
getMat(fit, "Z")
getMat(fit, "Zday")
getMat(fit, "Zday:run")
getMat(fit, "Zerror")
fit2 <- anovaMM(y~day/(run), dataEP05A2_1)
getMat(fit2, "V")			 	# Var(y)
getMat(fit2, "G")				# Var(re)

## End(Not run)

VCA documentation built on May 29, 2024, 1:48 a.m.