Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

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).

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

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)

glmmTMB

Generalized Linear Mixed Models using Template Model Builder

v1.0.2.1
AGPL-3
Authors
Arni Magnusson [aut] (<https://orcid.org/0000-0003-2769-6741>), Hans Skaug [aut], Anders Nielsen [aut] (<https://orcid.org/0000-0001-9683-9262>), Casper Berg [aut] (<https://orcid.org/0000-0002-3812-5269>), Kasper Kristensen [aut], Martin Maechler [aut] (<https://orcid.org/0000-0002-8685-9910>), Koen van Bentham [aut], Ben Bolker [aut] (<https://orcid.org/0000-0002-2127-0443>), Nafis Sadat [ctb] (<https://orcid.org/0000-0001-5715-616X>), Daniel Lüdecke [ctb] (<https://orcid.org/0000-0002-8895-3206>), Russ Lenth [ctb], Joseph O'Brien [ctb] (<https://orcid.org/0000-0001-9851-5077>), Mollie Brooks [aut, cre] (<https://orcid.org/0000-0001-6963-8326>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.