File: p_value_betwithin.Rd

package info (click to toggle)
r-cran-parameters 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,852 kB
  • sloc: sh: 16; makefile: 2
file content (83 lines) | stat: -rw-r--r-- 3,140 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ci_betwithin.R, R/dof_betwithin.R,
%   R/p_value_betwithin.R
\name{ci_betwithin}
\alias{ci_betwithin}
\alias{dof_betwithin}
\alias{p_value_betwithin}
\title{Between-within approximation for SEs, CIs and p-values}
\usage{
ci_betwithin(model, ci = 0.95, ...)

dof_betwithin(model)

p_value_betwithin(model, dof = NULL, ...)
}
\arguments{
\item{model}{A mixed model.}

\item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).}

\item{...}{Additional arguments passed down to the underlying functions.
E.g., arguments like \code{vcov} or \code{vcov_args} can be used to compute confidence
intervals using a specific variance-covariance matrix for the standard
errors.}

\item{dof}{Degrees of Freedom.}
}
\value{
A data frame.
}
\description{
Approximation of degrees of freedom based on a "between-within" heuristic.
}
\details{
\subsection{Small Sample Cluster corrected Degrees of Freedom}{

Inferential statistics (like p-values, confidence intervals and
standard errors) may be biased in mixed models when the number of clusters
is small (even if the sample size of level-1 units is high). In such cases
it is recommended to approximate a more accurate number of degrees of freedom
for such inferential statistics (see \emph{Li and Redden 2015}). The
\emph{Between-within} denominator degrees of freedom approximation is
recommended in particular for (generalized) linear mixed models with repeated
measurements (longitudinal design). \code{dof_betwithin()} implements a heuristic
based on the between-within approach. \strong{Note} that this implementation
does not return exactly the same results as shown in \emph{Li and Redden 2015},
but similar.
}

\subsection{Degrees of Freedom for Longitudinal Designs (Repeated Measures)}{

In particular for repeated measure designs (longitudinal data analysis),
the \emph{between-within} heuristic is likely to be more accurate than simply
using the residual or infinite degrees of freedom, because \code{dof_betwithin()}
returns different degrees of freedom for within-cluster and between-cluster
effects.
}
}
\examples{
\donttest{
if (require("lme4")) {
  data(sleepstudy)
  model <- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
  dof_betwithin(model)
  p_value_betwithin(model)
}
}
}
\references{
\itemize{
\item Elff, M.; Heisig, J.P.; Schaeffer, M.; Shikano, S. (2019). Multilevel
Analysis with Few Clusters: Improving Likelihood-based Methods to Provide
Unbiased Estimates and Accurate Inference, British Journal of Political Science.
\item Li, P., Redden, D. T. (2015). Comparing denominator degrees of freedom
approximations for the generalized linear mixed model in analyzing binary
outcome in small sample cluster-randomized trials. BMC Medical Research
Methodology, 15(1), 38. \doi{10.1186/s12874-015-0026-x}
}
}
\seealso{
\code{dof_betwithin()} is a small helper-function to calculate approximated
degrees of freedom of model parameters, based on the "between-within" heuristic.
}