File: random_parameters.Rd

package info (click to toggle)
r-cran-parameters 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,044 kB
  • sloc: sh: 15; makefile: 2
file content (56 lines) | stat: -rw-r--r-- 2,461 bytes parent folder | download
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/random_parameters.R
\name{random_parameters}
\alias{random_parameters}
\title{Summary information from random effects}
\usage{
random_parameters(model)
}
\arguments{
\item{model}{A mixed effects model (including \code{stanreg} models).}
}
\value{
A data frame with random effects statistics for the variance components,
  including number of levels per random effect group, as well as complete
  observations in the model.
}
\description{
This function extracts the different variance components of a
  mixed model and returns the result as a data frame.
}
\details{
The variance components are obtained from \code{\link[insight]{get_variance}}
  and are denoted as following:
  \subsection{Within-group (or residual) variance}{
    The residual variance, \ifelse{html}{\out{&sigma;<sup>2</sup><sub>&epsilon;</sub>}}{\eqn{\sigma^2_\epsilon}},
    is the sum of the distribution-specific variance and the variance due to additive dispersion.
    It indicates the \emph{within-group variance}.
  }
  \subsection{Between-group random intercept variance}{
    The random intercept variance, or \emph{between-group} variance
    for the intercept (\ifelse{html}{\out{&tau;<sub>00</sub>}}{\eqn{\tau_{00}}}),
    is obtained from \code{VarCorr()}. It indicates how much groups
    or subjects differ from each other.
  }
  \subsection{Between-group random slope variance}{
    The random slope variance, or \emph{between-group} variance
    for the slopes (\ifelse{html}{\out{&tau;<sub>11</sub>}}{\eqn{\tau_{11}}})
    is obtained from \code{VarCorr()}. This measure is only available
    for mixed models with random slopes. It indicates how much groups
    or subjects differ from each other according to their slopes.
  }
  \subsection{Random slope-intercept correlation}{
    The random slope-intercept correlation
    (\ifelse{html}{\out{&rho;<sub>01</sub>}}{\eqn{\rho_{01}}})
    is obtained from \code{VarCorr()}. This measure is only available
    for mixed models with random intercepts and slopes.
  }
  \strong{Note:} For the within-group and between-group variance, variance and standard deviations (which are simply the square root of the variance) are shown.
}
\examples{
if (require("lme4")) {
  data(sleepstudy)
  model <- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
  random_parameters(model)
}
}