Repository navigation
Expand file tree
/
Copy pathgetReStruc.Rd
More file actions
56 lines (51 loc) · 2.04 KB
/
Copy pathgetReStruc.Rd
File metadata and controls
56 lines (51 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glmmTMB.R
\name{getReStruc}
\alias{getReStruc}
\title{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,
full_cor = NULL
)
}
\arguments{
\item{reTrms}{random-effects terms list}
\item{ss}{a vector of character strings indicating a valid covariance structure (one for each RE term).
Must be one of \code{names(glmmTMB:::.valid_covstruct)};
default is to use an unstructured variance-covariance
matrix (\code{"us"}) for all blocks).}
\item{aa}{additional arguments (i.e. rank, or var-cov matrix)}
\item{reXterms}{terms objects corresponding to each RE term}
\item{fr}{model frame}
\item{full_cor}{compute full correlation matrices? can be either a length-1 logical vector (TRUE/FALSE) to include full correlation matrices for all or none of the random-effect terms in the model, or a logical vector with length equal to the number of correlation matrices, to include/exclude correlation matrices individually}
}
\value{
a list
\item{blockNumTheta}{number of variance covariance parameters per term}
\item{blockSize}{size (dimension) of one block}
\item{blockReps}{number of times the blocks are repeated (levels)}
\item{covCode}{structure code}
\item{simCode}{simulation code; should we "zero" (set to zero/ignore), "fix" (set to existing parameter values), "random" (draw new random deviations)?}
\item{fullCor}{logical vector (compute/store full correlation matrix?)}
}
\description{
Calculate random effect structure
Calculates number of random effects, number of parameters,
block size and number of blocks. Mostly for internal use.
}
\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)
getReStruc(rt2)
}