From b48a99224eec28d58b199af66a7c8325fdc6844e Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 19 Nov 2024 13:54:36 +0100 Subject: [PATCH] docs --- R/2_ci.R | 40 ++++++++++++++++++++++++---------------- R/methods_lme4.R | 1 - man/ci.default.Rd | 35 ++++++++++++++++------------------- man/p_value.Rd | 23 +++++++++++------------ man/standard_error.Rd | 15 +++++++-------- 5 files changed, 58 insertions(+), 56 deletions(-) diff --git a/R/2_ci.R b/R/2_ci.R index 89fe3b0c6..9e8a479ef 100644 --- a/R/2_ci.R +++ b/R/2_ci.R @@ -6,23 +6,22 @@ #' @param x A statistical model. #' @param ci Confidence Interval (CI) level. Default to `0.95` (`95%`). #' @param dof Number of degrees of freedom to be used when calculating -#' confidence intervals. If `NULL` (default), the degrees of freedom are -#' retrieved by calling [`insight::get_df()`] with approximation method -#' defined in `method`. If not `NULL`, use this argument to override the -#' default degrees of freedom used to compute confidence intervals. -#' @param method Method for computing degrees of freedom for -#' confidence intervals (CI) and the related p-values. Allowed are following -#' options (which vary depending on the model class): `"residual"`, -#' `"normal"`, `"likelihood"`, `"satterthwaite"`, `"kenward"`, `"wald"`, -#' `"profile"`, `"boot"`, `"uniroot"`, `"ml1"`, `"betwithin"`, `"hdi"`, -#' `"quantile"`, `"ci"`, `"eti"`, `"si"`, `"bci"`, or `"bcai"`. See section -#' _Confidence intervals and approximation of degrees of freedom_ in -#' [`model_parameters()`] for further details. +#' confidence intervals. If `NULL` (default), the degrees of freedom are +#' retrieved by calling [`insight::get_df()`] with approximation method defined +#' in `method`. If not `NULL`, use this argument to override the default degrees +#' of freedom used to compute confidence intervals. +#' @param method Method for computing degrees of freedom for confidence +#' intervals (CI) and the related p-values. Allowed are following options (which +#' vary depending on the model class): `"residual"`, `"normal"`, `"likelihood"`, +#' `"satterthwaite"`, `"kenward"`, `"wald"`, `"profile"`, `"boot"`, `"uniroot"`, +#' `"ml1"`, `"betwithin"`, `"hdi"`, `"quantile"`, `"ci"`, `"eti"`, `"si"`, +#' `"bci"`, or `"bcai"`. See section _Confidence intervals and approximation of +#' degrees of freedom_ in [`model_parameters()`] for further details. #' @param component Model component for which parameters should be shown. See -#' the documentation for your object's class in [`model_parameters()`] or -#' [`p_value()`] for further details, or see section _Model components_. +#' the documentation for your object's class in [`model_parameters()`] or +#' [`p_value()`] for further details, or see section _Model components_. #' @param iterations The number of bootstrap replicates. Only applies to models -#' of class `merMod` when `method=boot`. +#' of class `merMod` when `method=boot`. #' @param verbose Toggle warnings and messages. #' @param ... Additional arguments passed down to the underlying functions. #' E.g., arguments like `vcov` or `vcov_args` can be used to compute confidence @@ -64,6 +63,7 @@ ci.default <- function(x, ci = 0.95, dof = NULL, method = NULL, + iterations = 500, component = "all", vcov = NULL, vcov_args = NULL, @@ -71,7 +71,15 @@ ci.default <- function(x, ...) { # check for valid input .is_model_valid(x) - .ci_generic(model = x, ci = ci, dof = dof, method = method, ...) + .ci_generic( + model = x, + ci = ci, + dof = dof, + method = method, + component = component, + vcov = vcov, + vcov_args = vcov_args, + ...) } diff --git a/R/methods_lme4.R b/R/methods_lme4.R index 4a279b8c4..2bb3ed4ad 100644 --- a/R/methods_lme4.R +++ b/R/methods_lme4.R @@ -188,7 +188,6 @@ model_parameters.merMod <- function(model, } -#' @rdname ci.default #' @export ci.merMod <- function(x, ci = 0.95, diff --git a/man/ci.default.Rd b/man/ci.default.Rd index eac052884..7446511c0 100644 --- a/man/ci.default.Rd +++ b/man/ci.default.Rd @@ -1,8 +1,7 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/2_ci.R, R/methods_lme4.R +% Please edit documentation in R/2_ci.R \name{ci.default} \alias{ci.default} -\alias{ci.merMod} \title{Confidence Intervals (CI)} \usage{ \method{ci}{default}( @@ -10,14 +9,13 @@ ci = 0.95, dof = NULL, method = NULL, + iterations = 500, component = "all", vcov = NULL, vcov_args = NULL, verbose = TRUE, ... ) - -\method{ci}{merMod}(x, ci = 0.95, dof = NULL, method = "wald", iterations = 500, ...) } \arguments{ \item{x}{A statistical model.} @@ -26,18 +24,20 @@ \item{dof}{Number of degrees of freedom to be used when calculating confidence intervals. If \code{NULL} (default), the degrees of freedom are -retrieved by calling \code{\link[insight:get_df]{insight::get_df()}} with approximation method -defined in \code{method}. If not \code{NULL}, use this argument to override the -default degrees of freedom used to compute confidence intervals.} - -\item{method}{Method for computing degrees of freedom for -confidence intervals (CI) and the related p-values. Allowed are following -options (which vary depending on the model class): \code{"residual"}, -\code{"normal"}, \code{"likelihood"}, \code{"satterthwaite"}, \code{"kenward"}, \code{"wald"}, -\code{"profile"}, \code{"boot"}, \code{"uniroot"}, \code{"ml1"}, \code{"betwithin"}, \code{"hdi"}, -\code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, \code{"bci"}, or \code{"bcai"}. See section -\emph{Confidence intervals and approximation of degrees of freedom} in -\code{\link[=model_parameters]{model_parameters()}} for further details.} +retrieved by calling \code{\link[insight:get_df]{insight::get_df()}} with approximation method defined +in \code{method}. If not \code{NULL}, use this argument to override the default degrees +of freedom used to compute confidence intervals.} + +\item{method}{Method for computing degrees of freedom for confidence +intervals (CI) and the related p-values. Allowed are following options (which +vary depending on the model class): \code{"residual"}, \code{"normal"}, \code{"likelihood"}, +\code{"satterthwaite"}, \code{"kenward"}, \code{"wald"}, \code{"profile"}, \code{"boot"}, \code{"uniroot"}, +\code{"ml1"}, \code{"betwithin"}, \code{"hdi"}, \code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, +\code{"bci"}, or \code{"bcai"}. See section \emph{Confidence intervals and approximation of +degrees of freedom} in \code{\link[=model_parameters]{model_parameters()}} for further details.} + +\item{iterations}{The number of bootstrap replicates. Only applies to models +of class \code{merMod} when \code{method=boot}.} \item{component}{Model component for which parameters should be shown. See the documentation for your object's class in \code{\link[=model_parameters]{model_parameters()}} or @@ -78,9 +78,6 @@ type for \code{"HC"} equals the default from the \strong{sandwich} package; for 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{iterations}{The number of bootstrap replicates. Only applies to models -of class \code{merMod} when \code{method=boot}.} } \value{ A data frame containing the CI bounds. diff --git a/man/p_value.Rd b/man/p_value.Rd index 8b56249e1..8226f6c93 100644 --- a/man/p_value.Rd +++ b/man/p_value.Rd @@ -28,18 +28,17 @@ p_value(model, ...) \item{dof}{Number of degrees of freedom to be used when calculating confidence intervals. If \code{NULL} (default), the degrees of freedom are -retrieved by calling \code{\link[insight:get_df]{insight::get_df()}} with approximation method -defined in \code{method}. If not \code{NULL}, use this argument to override the -default degrees of freedom used to compute confidence intervals.} - -\item{method}{Method for computing degrees of freedom for -confidence intervals (CI) and the related p-values. Allowed are following -options (which vary depending on the model class): \code{"residual"}, -\code{"normal"}, \code{"likelihood"}, \code{"satterthwaite"}, \code{"kenward"}, \code{"wald"}, -\code{"profile"}, \code{"boot"}, \code{"uniroot"}, \code{"ml1"}, \code{"betwithin"}, \code{"hdi"}, -\code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, \code{"bci"}, or \code{"bcai"}. See section -\emph{Confidence intervals and approximation of degrees of freedom} in -\code{\link[=model_parameters]{model_parameters()}} for further details.} +retrieved by calling \code{\link[insight:get_df]{insight::get_df()}} with approximation method defined +in \code{method}. If not \code{NULL}, use this argument to override the default degrees +of freedom used to compute confidence intervals.} + +\item{method}{Method for computing degrees of freedom for confidence +intervals (CI) and the related p-values. Allowed are following options (which +vary depending on the model class): \code{"residual"}, \code{"normal"}, \code{"likelihood"}, +\code{"satterthwaite"}, \code{"kenward"}, \code{"wald"}, \code{"profile"}, \code{"boot"}, \code{"uniroot"}, +\code{"ml1"}, \code{"betwithin"}, \code{"hdi"}, \code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, +\code{"bci"}, or \code{"bcai"}. See section \emph{Confidence intervals and approximation of +degrees of freedom} in \code{\link[=model_parameters]{model_parameters()}} for further details.} \item{component}{Model component for which parameters should be shown. See the documentation for your object's class in \code{\link[=model_parameters]{model_parameters()}} or diff --git a/man/standard_error.Rd b/man/standard_error.Rd index d954d1db2..3a864e342 100644 --- a/man/standard_error.Rd +++ b/man/standard_error.Rd @@ -91,14 +91,13 @@ to mixed models. May be abbreviated. When standard errors for random effects are requested, for each grouping factor a list of standard errors (per group level) for random intercepts and slopes is returned.} -\item{method}{Method for computing degrees of freedom for -confidence intervals (CI) and the related p-values. Allowed are following -options (which vary depending on the model class): \code{"residual"}, -\code{"normal"}, \code{"likelihood"}, \code{"satterthwaite"}, \code{"kenward"}, \code{"wald"}, -\code{"profile"}, \code{"boot"}, \code{"uniroot"}, \code{"ml1"}, \code{"betwithin"}, \code{"hdi"}, -\code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, \code{"bci"}, or \code{"bcai"}. See section -\emph{Confidence intervals and approximation of degrees of freedom} in -\code{\link[=model_parameters]{model_parameters()}} for further details.} +\item{method}{Method for computing degrees of freedom for confidence +intervals (CI) and the related p-values. Allowed are following options (which +vary depending on the model class): \code{"residual"}, \code{"normal"}, \code{"likelihood"}, +\code{"satterthwaite"}, \code{"kenward"}, \code{"wald"}, \code{"profile"}, \code{"boot"}, \code{"uniroot"}, +\code{"ml1"}, \code{"betwithin"}, \code{"hdi"}, \code{"quantile"}, \code{"ci"}, \code{"eti"}, \code{"si"}, +\code{"bci"}, or \code{"bcai"}. See section \emph{Confidence intervals and approximation of +degrees of freedom} in \code{\link[=model_parameters]{model_parameters()}} for further details.} } \value{ A data frame with at least two columns: the parameter names and the