From 9902717ff3923a9075d9a7e6db50f5b6c9f0d7a8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 6 Oct 2024 20:37:42 +0200 Subject: [PATCH] consistent order of arguments --- R/1_model_parameters.R | 10 +++--- R/methods_cplm.R | 4 +-- R/methods_fixest.R | 8 ++--- R/methods_glmmTMB.R | 2 +- R/methods_lme4.R | 6 ++-- R/methods_nestedLogit.R | 4 +-- R/methods_svy2lme.R | 2 +- man/model_parameters.default.Rd | 62 ++++++++++++++++----------------- man/model_parameters.merMod.Rd | 18 +++++----- man/model_parameters.zcpglm.Rd | 16 ++++----- 10 files changed, 66 insertions(+), 66 deletions(-) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 02555cd6d..ab2c75968 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -567,13 +567,13 @@ model_parameters.default <- function(model, standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, verbose = TRUE, - vcov = NULL, - vcov_args = NULL, ...) { # validation check for inputs .is_model_valid(model) @@ -665,9 +665,9 @@ model_parameters.default <- function(model, include_info = FALSE, keep_parameters = NULL, drop_parameters = NULL, - verbose = TRUE, vcov = NULL, vcov_args = NULL, + verbose = TRUE, ...) { dots <- list(...) @@ -759,12 +759,12 @@ model_parameters.glm <- function(model, standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, - vcov = NULL, - vcov_args = NULL, verbose = TRUE, ...) { dots <- list(...) diff --git a/R/methods_cplm.R b/R/methods_cplm.R index b077e8d9c..ad8efa25f 100644 --- a/R/methods_cplm.R +++ b/R/methods_cplm.R @@ -36,10 +36,10 @@ model_parameters.zcpglm <- function(model, standardize = NULL, exponentiate = FALSE, p_adjust = NULL, - keep = NULL, - drop = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), + keep = NULL, + drop = NULL, verbose = TRUE, ...) { component <- match.arg(component) diff --git a/R/methods_fixest.R b/R/methods_fixest.R index ddc7c3c49..74f724d17 100644 --- a/R/methods_fixest.R +++ b/R/methods_fixest.R @@ -9,13 +9,13 @@ model_parameters.fixest <- function(model, standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, verbose = TRUE, - vcov = NULL, - vcov_args = NULL, ...) { # default ci-method, based on statistic if (is.null(ci_method)) { @@ -131,13 +131,13 @@ model_parameters.fixest_multi <- function(model, standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, verbose = TRUE, - vcov = NULL, - vcov_args = NULL, ...) { ## TODO remove deprecated later if (!missing(summary)) { diff --git a/R/methods_glmmTMB.R b/R/methods_glmmTMB.R index 0d1b6e328..26ad72dd1 100644 --- a/R/methods_glmmTMB.R +++ b/R/methods_glmmTMB.R @@ -22,10 +22,10 @@ model_parameters.glmmTMB <- function(model, wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, ...) { insight::check_if_installed("glmmTMB") diff --git a/R/methods_lme4.R b/R/methods_lme4.R index 08eb009f4..4d55dac15 100644 --- a/R/methods_lme4.R +++ b/R/methods_lme4.R @@ -159,15 +159,15 @@ model_parameters.merMod <- function(model, group_level = FALSE, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, - vcov = NULL, - vcov_args = NULL, ...) { dots <- list(...) diff --git a/R/methods_nestedLogit.R b/R/methods_nestedLogit.R index 0ef47b628..bec97e33a 100644 --- a/R/methods_nestedLogit.R +++ b/R/methods_nestedLogit.R @@ -8,12 +8,12 @@ model_parameters.nestedLogit <- function(model, standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, - vcov = NULL, - vcov_args = NULL, verbose = TRUE, ...) { dots <- list(...) diff --git a/R/methods_svy2lme.R b/R/methods_svy2lme.R index e34e7bb88..cc7e9f83a 100644 --- a/R/methods_svy2lme.R +++ b/R/methods_svy2lme.R @@ -2,10 +2,10 @@ model_parameters.svy2lme <- function(model, ci = 0.95, effects = "all", + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, ...) { dots <- list(...) # which component to return? diff --git a/man/model_parameters.default.Rd b/man/model_parameters.default.Rd index 19dafbd14..132dc2d5d 100644 --- a/man/model_parameters.default.Rd +++ b/man/model_parameters.default.Rd @@ -17,13 +17,13 @@ standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, verbose = TRUE, - vcov = NULL, - vcov_args = NULL, ... ) @@ -36,12 +36,12 @@ standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, - vcov = NULL, - vcov_args = NULL, verbose = TRUE, ... ) @@ -55,13 +55,13 @@ standardize = NULL, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), keep = NULL, drop = NULL, verbose = TRUE, - vcov = NULL, - vcov_args = NULL, ... ) @@ -125,6 +125,31 @@ possible adjustment methods are \code{"tukey"}, \code{"scheffe"}, \code{"sidak"} and \code{"none"} to explicitly disable adjustment for \code{emmGrid} objects (from \strong{emmeans}).} +\item{vcov}{Variance-covariance matrix used to compute uncertainty estimates +(e.g., for robust standard errors). This argument accepts a covariance matrix, +a function which returns a covariance matrix, or a string which identifies +the function to be used to compute the covariance matrix. +\itemize{ +\item A covariance matrix +\item A function which returns a covariance matrix (e.g., \code{stats::vcov()}) +\item A string which indicates the kind of uncertainty estimates to return. +\itemize{ +\item Heteroskedasticity-consistent: \code{"vcovHC"}, \code{"HC"}, \code{"HC0"}, \code{"HC1"}, +\code{"HC2"}, \code{"HC3"}, \code{"HC4"}, \code{"HC4m"}, \code{"HC5"}. See \code{?sandwich::vcovHC}. +\item Cluster-robust: \code{"vcovCR"}, \code{"CR0"}, \code{"CR1"}, \code{"CR1p"}, \code{"CR1S"}, +\code{"CR2"}, \code{"CR3"}. See \code{?clubSandwich::vcovCR}. +\item Bootstrap: \code{"vcovBS"}, \code{"xy"}, \code{"residual"}, \code{"wild"}, \code{"mammen"}, +\code{"webb"}. See \code{?sandwich::vcovBS}. +\item Other \code{sandwich} package functions: \code{"vcovHAC"}, \code{"vcovPC"}, \code{"vcovCL"}, +\code{"vcovPL"}. +} +}} + +\item{vcov_args}{List of arguments to be passed to the function identified by +the \code{vcov} argument. This function is typically supplied by the \strong{sandwich} +or \strong{clubSandwich} packages. Please refer to their documentation (e.g., +\code{?sandwich::vcovHAC}) to see the list of available arguments.} + \item{summary}{Deprecated, please use \code{info} instead.} \item{include_info}{Logical, if \code{TRUE}, prints summary information about the @@ -155,31 +180,6 @@ names.} \item{verbose}{Toggle warnings and messages.} -\item{vcov}{Variance-covariance matrix used to compute uncertainty estimates -(e.g., for robust standard errors). This argument accepts a covariance matrix, -a function which returns a covariance matrix, or a string which identifies -the function to be used to compute the covariance matrix. -\itemize{ -\item A covariance matrix -\item A function which returns a covariance matrix (e.g., \code{stats::vcov()}) -\item A string which indicates the kind of uncertainty estimates to return. -\itemize{ -\item Heteroskedasticity-consistent: \code{"vcovHC"}, \code{"HC"}, \code{"HC0"}, \code{"HC1"}, -\code{"HC2"}, \code{"HC3"}, \code{"HC4"}, \code{"HC4m"}, \code{"HC5"}. See \code{?sandwich::vcovHC}. -\item Cluster-robust: \code{"vcovCR"}, \code{"CR0"}, \code{"CR1"}, \code{"CR1p"}, \code{"CR1S"}, -\code{"CR2"}, \code{"CR3"}. See \code{?clubSandwich::vcovCR}. -\item Bootstrap: \code{"vcovBS"}, \code{"xy"}, \code{"residual"}, \code{"wild"}, \code{"mammen"}, -\code{"webb"}. See \code{?sandwich::vcovBS}. -\item Other \code{sandwich} package functions: \code{"vcovHAC"}, \code{"vcovPC"}, \code{"vcovCL"}, -\code{"vcovPL"}. -} -}} - -\item{vcov_args}{List of arguments to be passed to the function identified by -the \code{vcov} argument. This function is typically supplied by the \strong{sandwich} -or \strong{clubSandwich} packages. Please refer to their documentation (e.g., -\code{?sandwich::vcovHAC}) to see the list of available arguments.} - \item{...}{Arguments passed to or from other methods. For instance, when \code{bootstrap = TRUE}, arguments like \code{type} or \code{parallel} are passed down to \code{bootstrap_model()}. Further non-documented arguments are \code{digits}, diff --git a/man/model_parameters.merMod.Rd b/man/model_parameters.merMod.Rd index 96f86812b..a5c99f91e 100644 --- a/man/model_parameters.merMod.Rd +++ b/man/model_parameters.merMod.Rd @@ -48,10 +48,10 @@ wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, ... ) @@ -67,15 +67,15 @@ group_level = FALSE, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, - vcov = NULL, - vcov_args = NULL, ... ) @@ -95,10 +95,10 @@ wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, ... ) @@ -118,10 +118,10 @@ wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, ... ) @@ -137,15 +137,15 @@ group_level = FALSE, exponentiate = FALSE, p_adjust = NULL, + vcov = NULL, + vcov_args = NULL, wb_component = TRUE, summary = getOption("parameters_mixed_summary", FALSE), include_info = getOption("parameters_mixed_info", FALSE), + include_sigma = FALSE, keep = NULL, drop = NULL, verbose = TRUE, - include_sigma = FALSE, - vcov = NULL, - vcov_args = NULL, ... ) diff --git a/man/model_parameters.zcpglm.Rd b/man/model_parameters.zcpglm.Rd index e906df8d6..c9d67ae9d 100644 --- a/man/model_parameters.zcpglm.Rd +++ b/man/model_parameters.zcpglm.Rd @@ -14,10 +14,10 @@ standardize = NULL, exponentiate = FALSE, p_adjust = NULL, - keep = NULL, - drop = NULL, summary = getOption("parameters_summary", FALSE), include_info = getOption("parameters_info", FALSE), + keep = NULL, + drop = NULL, verbose = TRUE, ... ) @@ -89,6 +89,12 @@ possible adjustment methods are \code{"tukey"}, \code{"scheffe"}, \code{"sidak"} and \code{"none"} to explicitly disable adjustment for \code{emmGrid} objects (from \strong{emmeans}).} +\item{summary}{Deprecated, please use \code{info} instead.} + +\item{include_info}{Logical, if \code{TRUE}, prints summary information about the +model (model formula, number of observations, residual standard deviation +and more).} + \item{keep}{Character containing a regular expression pattern that describes the parameters that should be included (for \code{keep}) or excluded (for \code{drop}) in the returned data frame. \code{keep} may also be a @@ -111,12 +117,6 @@ names.} \item{drop}{See \code{keep}.} -\item{summary}{Deprecated, please use \code{info} instead.} - -\item{include_info}{Logical, if \code{TRUE}, prints summary information about the -model (model formula, number of observations, residual standard deviation -and more).} - \item{verbose}{Toggle warnings and messages.} \item{...}{Arguments passed to or from other methods. For instance, when