Learn R Programming

glmmTMB (version 1.1.10)

getReStruc: Calculate random effect structure Calculates number of random effects, number of parameters, block size and number of blocks. Mostly for internal use.

Description

Calculate random effect structure Calculates number of random effects, number of parameters, block size and number of blocks. Mostly for internal use.

Usage

getReStruc(reTrms, ss = NULL, aa = NULL, reXterms = NULL, fr = NULL)

Value

a list

blockNumTheta

number of variance covariance parameters per term

blockSize

size (dimension) of one block

blockReps

number of times the blocks are repeated (levels)

covCode

structure code

simCode

simulation code; should we "zero" (set to zero/ignore), "fix" (set to existing parameter values), "random" (draw new random deviations)?

Arguments

reTrms

random-effects terms list

ss

a vector of character strings indicating a valid covariance structure (one for each RE term). Must be one of names(glmmTMB:::.valid_covstruct); default is to use an unstructured variance-covariance matrix ("us") for all blocks).

aa

additional arguments (i.e. rank, or var-cov matrix)

reXterms

terms objects corresponding to each RE term

fr

model frame

Examples

Run this code
data(sleepstudy, package="lme4")
rt <- lme4::lFormula(Reaction~Days+(1|Subject)+(0+Days|Subject),
                    sleepstudy)$reTrms
rt2 <- lme4::lFormula(Reaction~Days+(Days|Subject),
                    sleepstudy)$reTrms
getReStruc(rt)
getReStruc(rt2)

Run the code above in your browser using DataLab