getReStruc: Calculate random effect structure Calculates number of random...

Description Usage Arguments Value Examples

View source: R/glmmTMB.R

Description

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

Usage

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

Arguments

reTrms

random-effects terms list

ss

a character string indicating a valid covariance structure. 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)

reXterms

terms objects corresponding to each RE term

fr

model frame

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

Examples

1
2
3
4
5
6
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)

Example output

Warning message:
In checkMatrixPackageVersion() : Package version inconsistency detected.
TMB was built with Matrix version 1.2.10
Current Matrix version is 1.2.11
Please re-install 'TMB' from source or restore original 'Matrix' package
$`1 | Subject`
$`1 | Subject`$blockReps
[1] 18

$`1 | Subject`$blockSize
[1] 1

$`1 | Subject`$blockNumTheta
[1] 1

$`1 | Subject`$blockCode
us 
 1 


$`0 + Days | Subject`
$`0 + Days | Subject`$blockReps
[1] 18

$`0 + Days | Subject`$blockSize
[1] 1

$`0 + Days | Subject`$blockNumTheta
[1] 1

$`0 + Days | Subject`$blockCode
us 
 1 

glmmTMB documentation built on July 20, 2021, 9:06 a.m.