From 70cee9babea6b52b6725d494f81b1a1428f75537 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Oct 2023 06:42:43 +0200 Subject: [PATCH] Reduce number of methods in docs (#907) * Reduce number of methods in docs * fix --- R/methods_FactoMineR.R | 6 +- R/methods_PMCMRplus.R | 1 - R/methods_aov.R | 5 - R/methods_bamlss.R | 1 - R/methods_bayesQR.R | 1 - R/methods_bbmle.R | 1 - R/methods_cplm.R | 1 - R/methods_emmeans.R | 1 - R/methods_epi2x2.R | 1 - R/methods_fitdistr.R | 1 - R/methods_gam.R | 1 - R/methods_gamlss.R | 10 +- R/methods_gjrm.R | 1 - R/methods_ivfixed.R | 1 - R/methods_ivprobit.R | 1 - R/methods_lmodel2.R | 1 - R/methods_logistf.R | 1 - R/methods_lrm.R | 1 - R/methods_marginaleffects.R | 5 - R/methods_margins.R | 8 +- R/methods_mass.R | 4 - R/methods_maxLik.R | 2 - R/methods_mediate.R | 3 +- R/methods_metaplus.R | 1 - R/methods_mfx.R | 7 - R/methods_multcomp.R | 1 - R/methods_pscl.R | 12 - R/methods_psych.R | 3 - R/methods_quantreg.R | 2 - R/methods_sem.R | 1 - R/methods_stats4.R | 1 - R/methods_systemfit.R | 1 - R/methods_varest.R | 1 - R/methods_vgam.R | 1 - R/methods_wrs2.R | 137 ++++---- _pkgdown.yml | 2 +- man/model_parameters.aov.Rd | 100 ------ man/model_parameters.averaging.Rd | 506 +----------------------------- man/model_parameters.cgam.Rd | 53 +--- man/model_parameters.default.Rd | 38 --- man/model_parameters.glht.Rd | 94 ++++++ man/model_parameters.principal.Rd | 98 +----- man/model_parameters.stanreg.Rd | 99 +----- man/model_parameters.t1way.Rd | 47 +++ man/model_parameters.zcpglm.Rd | 54 +--- 45 files changed, 252 insertions(+), 1065 deletions(-) create mode 100644 man/model_parameters.glht.Rd create mode 100644 man/model_parameters.t1way.Rd diff --git a/R/methods_FactoMineR.R b/R/methods_FactoMineR.R index 1376d684a..4de274ec6 100644 --- a/R/methods_FactoMineR.R +++ b/R/methods_FactoMineR.R @@ -59,10 +59,10 @@ model_parameters.PCA <- function(model, # add class-attribute for printing - if ("PCA" %in% class(model)) { + if (inherits(model, "PCA")) { attr(loadings, "type") <- "pca" class(loadings) <- unique(c("parameters_pca", "see_parameters_pca", class(loadings))) - } else if ("FAMD" %in% class(model)) { + } else if (inherits(model, "FAMD")) { attr(loadings, "type") <- "fa" class(loadings) <- unique(c("parameters_efa", "see_parameters_efa", class(loadings))) } @@ -70,7 +70,5 @@ model_parameters.PCA <- function(model, loadings } - -#' @rdname model_parameters.principal #' @export model_parameters.FAMD <- model_parameters.PCA diff --git a/R/methods_PMCMRplus.R b/R/methods_PMCMRplus.R index 388aa7728..6ace9c636 100644 --- a/R/methods_PMCMRplus.R +++ b/R/methods_PMCMRplus.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.PMCMR <- function(model, ...) { insight::check_if_installed("PMCMRplus") diff --git a/R/methods_aov.R b/R/methods_aov.R index 23bf32c85..61ca4cb36 100644 --- a/R/methods_aov.R +++ b/R/methods_aov.R @@ -255,7 +255,6 @@ standard_error.anova <- standard_error.aov #' @export p_value.anova <- p_value.aov -#' @rdname model_parameters.aov #' @export model_parameters.anova <- model_parameters.aov @@ -269,7 +268,6 @@ standard_error.aovlist <- standard_error.aov #' @export p_value.aovlist <- p_value.aov -#' @rdname model_parameters.aov #' @export model_parameters.aovlist <- model_parameters.aov @@ -333,15 +331,12 @@ model_parameters.afex_aov <- function(model, # others ------ -#' @rdname model_parameters.aov #' @export model_parameters.anova.rms <- model_parameters.aov -#' @rdname model_parameters.aov #' @export model_parameters.Anova.mlm <- model_parameters.aov -#' @rdname model_parameters.aov #' @export model_parameters.maov <- model_parameters.aov diff --git a/R/methods_bamlss.R b/R/methods_bamlss.R index eaf0978f0..9b8c540bc 100644 --- a/R/methods_bamlss.R +++ b/R/methods_bamlss.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.stanreg #' @inheritParams insight::get_parameters #' @export model_parameters.bamlss <- function(model, diff --git a/R/methods_bayesQR.R b/R/methods_bayesQR.R index 8ae3703de..eb488b621 100644 --- a/R/methods_bayesQR.R +++ b/R/methods_bayesQR.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.stanreg #' @export model_parameters.bayesQR <- function(model, centrality = "median", diff --git a/R/methods_bbmle.R b/R/methods_bbmle.R index 148d9b0f3..c0b1f5959 100644 --- a/R/methods_bbmle.R +++ b/R/methods_bbmle.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.mle2 <- model_parameters.glm diff --git a/R/methods_cplm.R b/R/methods_cplm.R index 4ac5aea9f..3ba6bf0ee 100644 --- a/R/methods_cplm.R +++ b/R/methods_cplm.R @@ -165,7 +165,6 @@ p_value.zcpglm <- function(model, ########## .bcpglm --------------- -#' @rdname model_parameters.stanreg #' @export model_parameters.bcplm <- model_parameters.bayesQR diff --git a/R/methods_emmeans.R b/R/methods_emmeans.R index 133b416b2..0c5e1bb84 100644 --- a/R/methods_emmeans.R +++ b/R/methods_emmeans.R @@ -3,7 +3,6 @@ # model_parameters ---------------- -#' @rdname model_parameters.averaging #' @export model_parameters.emmGrid <- function(model, ci = 0.95, diff --git a/R/methods_epi2x2.R b/R/methods_epi2x2.R index 90d057c9a..c6e5bb02b 100644 --- a/R/methods_epi2x2.R +++ b/R/methods_epi2x2.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.epi.2by2 <- function(model, verbose = TRUE, ...) { # get parameter estimates diff --git a/R/methods_fitdistr.R b/R/methods_fitdistr.R index aabf7316c..295b5a706 100644 --- a/R/methods_fitdistr.R +++ b/R/methods_fitdistr.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.fitdistr <- function(model, exponentiate = FALSE, diff --git a/R/methods_gam.R b/R/methods_gam.R index 935ce01fa..43a31a21e 100644 --- a/R/methods_gam.R +++ b/R/methods_gam.R @@ -4,7 +4,6 @@ #################### .gam ------ -#' @rdname model_parameters.cgam #' @export model_parameters.gam <- model_parameters.cgam diff --git a/R/methods_gamlss.R b/R/methods_gamlss.R index bfc79253d..9772adcdc 100644 --- a/R/methods_gamlss.R +++ b/R/methods_gamlss.R @@ -1,6 +1,6 @@ #################### .gamlss ------ -#' @rdname model_parameters.cgam + #' @export model_parameters.gamlss <- model_parameters.gam @@ -8,7 +8,9 @@ model_parameters.gamlss <- model_parameters.gam #' @export standard_error.gamlss <- function(model, ...) { parms <- insight::get_parameters(model) - utils::capture.output(cs <- summary(model)) + utils::capture.output({ + cs <- summary(model) + }) .data_frame( Parameter = parms$Parameter, @@ -21,7 +23,9 @@ standard_error.gamlss <- function(model, ...) { #' @export p_value.gamlss <- function(model, ...) { parms <- insight::get_parameters(model) - utils::capture.output(cs <- summary(model)) + utils::capture.output({ + cs <- summary(model) + }) .data_frame( Parameter = parms$Parameter, p = as.vector(cs[, 4]), diff --git a/R/methods_gjrm.R b/R/methods_gjrm.R index 64607c5cc..b7b89f122 100644 --- a/R/methods_gjrm.R +++ b/R/methods_gjrm.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.SemiParBIV <- function(model, ci = 0.95, diff --git a/R/methods_ivfixed.R b/R/methods_ivfixed.R index 167479141..6c175646c 100644 --- a/R/methods_ivfixed.R +++ b/R/methods_ivfixed.R @@ -33,7 +33,6 @@ p_value.ivFixed <- function(model, method = "wald", ...) { } -#' @rdname model_parameters.averaging #' @export model_parameters.ivFixed <- function(model, ci = 0.95, diff --git a/R/methods_ivprobit.R b/R/methods_ivprobit.R index 3676fa170..826719b71 100644 --- a/R/methods_ivprobit.R +++ b/R/methods_ivprobit.R @@ -20,6 +20,5 @@ standard_error.ivprobit <- function(model, ...) { p_value.ivprobit <- p_value.default -#' @rdname model_parameters.averaging #' @export model_parameters.ivprobit <- model_parameters.ivFixed diff --git a/R/methods_lmodel2.R b/R/methods_lmodel2.R index 1ecebece8..f789dd7d6 100644 --- a/R/methods_lmodel2.R +++ b/R/methods_lmodel2.R @@ -1,7 +1,6 @@ # lmodel2 -#' @rdname model_parameters.averaging #' @export model_parameters.lmodel2 <- function(model, ci = 0.95, diff --git a/R/methods_logistf.R b/R/methods_logistf.R index 147b51685..2912c488b 100644 --- a/R/methods_logistf.R +++ b/R/methods_logistf.R @@ -1,6 +1,5 @@ # model_parameters -------------------- -#' @rdname model_parameters.averaging #' @export model_parameters.logistf <- model_parameters.glm diff --git a/R/methods_lrm.R b/R/methods_lrm.R index fd973be42..f919e0cb9 100644 --- a/R/methods_lrm.R +++ b/R/methods_lrm.R @@ -4,7 +4,6 @@ # model parameters ------------- -#' @rdname model_parameters.stanreg #' @export model_parameters.blrm <- model_parameters.bayesQR diff --git a/R/methods_marginaleffects.R b/R/methods_marginaleffects.R index 2ea350374..701cada2f 100644 --- a/R/methods_marginaleffects.R +++ b/R/methods_marginaleffects.R @@ -46,27 +46,22 @@ model_parameters.marginaleffects <- function(model, out } -#' @rdname model_parameters.averaging #' @export model_parameters.comparisons <- model_parameters.marginaleffects -#' @rdname model_parameters.averaging #' @export model_parameters.marginalmeans <- model_parameters.marginaleffects -#' @rdname model_parameters.averaging #' @export model_parameters.hypotheses <- model_parameters.marginaleffects -#' @rdname model_parameters.averaging #' @export model_parameters.slopes <- model_parameters.marginaleffects -#' @rdname model_parameters.averaging #' @export model_parameters.predictions <- function(model, ci = 0.95, diff --git a/R/methods_margins.R b/R/methods_margins.R index 73818078b..887478670 100644 --- a/R/methods_margins.R +++ b/R/methods_margins.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.margins <- function(model, ci = 0.95, exponentiate = FALSE, p_adjust = NULL, verbose = TRUE, ...) { # Parameters, Estimate and CI @@ -21,7 +20,12 @@ model_parameters.margins <- function(model, ci = 0.95, exponentiate = FALSE, p_a # ==== Renaming if ("Statistic" %in% names(params)) { - names(params) <- gsub("Statistic", gsub("(-|\\s)statistic", "", attr(statistic, "statistic", exact = TRUE)), names(params)) + names(params) <- gsub( + "Statistic", + gsub("(-|\\s)statistic", "", attr(statistic, "statistic", exact = TRUE)), + names(params), + fixed = TRUE + ) names(params) <- gsub("chi-squared", "Chi2", names(params), fixed = TRUE) } names(params) <- gsub("(c|C)hisq", "Chi2", names(params)) diff --git a/R/methods_mass.R b/R/methods_mass.R index 49c3bd346..57804441d 100644 --- a/R/methods_mass.R +++ b/R/methods_mass.R @@ -133,12 +133,8 @@ model_parameters.ridgelm <- function(model, verbose = TRUE, ...) { parameters } - -#' @rdname model_parameters.default #' @export model_parameters.polr <- model_parameters.glm - -#' @rdname model_parameters.default #' @export model_parameters.negbin <- model_parameters.glm diff --git a/R/methods_maxLik.R b/R/methods_maxLik.R index a525a4004..d032ea1ea 100644 --- a/R/methods_maxLik.R +++ b/R/methods_maxLik.R @@ -1,12 +1,10 @@ # .maxLik, .maxim -#' @rdname model_parameters.averaging #' @export model_parameters.maxLik <- model_parameters.default -#' @rdname model_parameters.averaging #' @export model_parameters.maxim <- model_parameters.default diff --git a/R/methods_mediate.R b/R/methods_mediate.R index 699e565bc..ef907a9ca 100644 --- a/R/methods_mediate.R +++ b/R/methods_mediate.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.mediate <- function(model, ci = 0.95, exponentiate = FALSE, verbose = TRUE, ...) { # Parameters, Estimate and CI @@ -13,7 +12,7 @@ model_parameters.mediate <- function(model, ci = 0.95, exponentiate = FALSE, ver # ==== Renaming - if (any(grepl("\\(control\\)$", params$Parameter))) { + if (any(endsWith(params$Parameter, "(control)"))) { params$Component <- gsub("(.*)\\((.*)\\)$", "\\2", params$Parameter) } diff --git a/R/methods_metaplus.R b/R/methods_metaplus.R index b227844ff..72641bfd1 100644 --- a/R/methods_metaplus.R +++ b/R/methods_metaplus.R @@ -290,7 +290,6 @@ ci.meta_random <- function(x, method = "eti", ...) { ###### .meta_fixed ------------------- -#' @rdname model_parameters.averaging #' @export model_parameters.meta_fixed <- model_parameters.meta_random diff --git a/R/methods_mfx.R b/R/methods_mfx.R index 20871a184..7709fb31d 100644 --- a/R/methods_mfx.R +++ b/R/methods_mfx.R @@ -1,7 +1,6 @@ # model parameters --------------------- -#' @rdname model_parameters.averaging #' @export model_parameters.logitor <- function(model, ci = 0.95, @@ -25,17 +24,14 @@ model_parameters.logitor <- function(model, } -#' @rdname model_parameters.averaging #' @export model_parameters.poissonirr <- model_parameters.logitor -#' @rdname model_parameters.averaging #' @export model_parameters.negbinirr <- model_parameters.logitor -#' @rdname model_parameters.averaging #' @export model_parameters.poissonmfx <- function(model, ci = 0.95, @@ -71,17 +67,14 @@ model_parameters.poissonmfx <- function(model, } -#' @rdname model_parameters.averaging #' @export model_parameters.logitmfx <- model_parameters.poissonmfx -#' @rdname model_parameters.averaging #' @export model_parameters.probitmfx <- model_parameters.poissonmfx -#' @rdname model_parameters.averaging #' @export model_parameters.negbinmfx <- model_parameters.poissonmfx diff --git a/R/methods_multcomp.R b/R/methods_multcomp.R index a7760fd54..f906c1560 100644 --- a/R/methods_multcomp.R +++ b/R/methods_multcomp.R @@ -2,7 +2,6 @@ #' #' Parameters from Hypothesis Testing. #' -#' @rdname model_parameters.averaging #' @param model Object of class [multcomp::glht()] (**multcomp**) #' or of class `PMCMR`, `trendPMCMR` or `osrt` (**PMCMRplus**). #' @inheritParams model_parameters.default diff --git a/R/methods_pscl.R b/R/methods_pscl.R index c30d7c4c8..a0ac9d7e5 100644 --- a/R/methods_pscl.R +++ b/R/methods_pscl.R @@ -2,16 +2,12 @@ # model parameters ----------------- -#' @rdname model_parameters.zcpglm #' @export model_parameters.zeroinfl <- model_parameters.zcpglm -#' @rdname model_parameters.zcpglm #' @export model_parameters.hurdle <- model_parameters.zcpglm - -#' @rdname model_parameters.zcpglm #' @export model_parameters.zerocount <- model_parameters.zcpglm @@ -40,11 +36,9 @@ ci.zeroinfl <- function(x, .ci_generic(model = x, ci = ci, dof = dof, method = method, component = component, ...) } - #' @export ci.hurdle <- ci.zeroinfl - #' @export ci.zerocount <- ci.zeroinfl @@ -100,11 +94,9 @@ standard_error.zeroinfl <- function(model, .filter_component(se, component) } - #' @export standard_error.hurdle <- standard_error.zeroinfl - #' @export standard_error.zerocount <- standard_error.zeroinfl @@ -160,11 +152,9 @@ p_value.zeroinfl <- function(model, .filter_component(p, component) } - #' @export p_value.hurdle <- p_value.zeroinfl - #' @export p_value.zerocount <- p_value.zeroinfl @@ -230,10 +220,8 @@ simulate_parameters.zeroinfl <- function(model, out } - #' @export simulate_parameters.hurdle <- simulate_parameters.zeroinfl - #' @export simulate_parameters.zerocount <- simulate_parameters.zeroinfl diff --git a/R/methods_psych.R b/R/methods_psych.R index b1d013fc7..401296aa1 100644 --- a/R/methods_psych.R +++ b/R/methods_psych.R @@ -234,7 +234,6 @@ model_parameters.principal <- function(model, loadings } - #' @export model_parameters.fa <- model_parameters.principal @@ -242,8 +241,6 @@ model_parameters.fa <- model_parameters.principal model_parameters.fa.ci <- model_parameters.fa - -#' @rdname model_parameters.principal #' @export model_parameters.omega <- function(model, verbose = TRUE, ...) { # Table of omega coefficients diff --git a/R/methods_quantreg.R b/R/methods_quantreg.R index 4685fda8e..9e61e68f7 100644 --- a/R/methods_quantreg.R +++ b/R/methods_quantreg.R @@ -3,12 +3,10 @@ # model parameters --------------------- -#' @rdname model_parameters.averaging #' @export model_parameters.rqss <- model_parameters.cgam -#' @rdname model_parameters.averaging #' @export model_parameters.rqs <- function(model, ci = 0.95, diff --git a/R/methods_sem.R b/R/methods_sem.R index 02a088594..ef1252528 100644 --- a/R/methods_sem.R +++ b/R/methods_sem.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.principal #' @export model_parameters.sem <- model_parameters.default diff --git a/R/methods_stats4.R b/R/methods_stats4.R index e652f76b3..78e53cf3d 100644 --- a/R/methods_stats4.R +++ b/R/methods_stats4.R @@ -6,6 +6,5 @@ ci.mle <- ci.glm standard_error.mle <- standard_error.mle2 -#' @rdname model_parameters.averaging #' @export model_parameters.mle <- model_parameters.glm diff --git a/R/methods_systemfit.R b/R/methods_systemfit.R index 05ab1e009..7e087d77b 100644 --- a/R/methods_systemfit.R +++ b/R/methods_systemfit.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.averaging #' @export model_parameters.systemfit <- function(model, ci = 0.95, diff --git a/R/methods_varest.R b/R/methods_varest.R index 07516e649..d666a5601 100644 --- a/R/methods_varest.R +++ b/R/methods_varest.R @@ -1,6 +1,5 @@ # .varest -#' @rdname model_parameters.averaging #' @export model_parameters.varest <- function(model, ci = 0.95, diff --git a/R/methods_vgam.R b/R/methods_vgam.R index 2bebc96db..750189fac 100644 --- a/R/methods_vgam.R +++ b/R/methods_vgam.R @@ -4,7 +4,6 @@ ########### .vgam --------------- -#' @rdname model_parameters.cgam #' @export model_parameters.vgam <- model_parameters.gam diff --git a/R/methods_wrs2.R b/R/methods_wrs2.R index 65a2bffe4..a72c7332a 100644 --- a/R/methods_wrs2.R +++ b/R/methods_wrs2.R @@ -14,7 +14,6 @@ # anova ---------------------- -#' @rdname model_parameters.averaging model_parameters.t1way <- function(model, keep = NULL, verbose = TRUE, ...) { parameters <- .extract_wrs2_t1way(model) parameters <- .add_htest_parameters_attributes(parameters, model, ...) @@ -27,31 +26,31 @@ model_parameters.t1way <- function(model, keep = NULL, verbose = TRUE, ...) { # effect sizes are by default contained for `t1way` but not `rmanova` if (grepl("^(t1way|WRS2::t1way)", fcall)) { data.frame( - "F" = model$test, - "df" = model$df1, - "df_error" = model$df2, - "p" = model$p.value, - "Method" = "A heteroscedastic one-way ANOVA for trimmed means", - "Estimate" = model$effsize, - "CI" = 1 - model$alpha, - "CI_low" = model$effsize_ci[1], - "CI_high" = model$effsize_ci[2], - "Effectsize" = "Explanatory measure of effect size", + `F` = model$test, + df = model$df1, + df_error = model$df2, + p = model$p.value, + Method = "A heteroscedastic one-way ANOVA for trimmed means", + Estimate = model$effsize, + CI = 1 - model$alpha, + CI_low = model$effsize_ci[1], + CI_high = model$effsize_ci[2], + Effectsize = "Explanatory measure of effect size", stringsAsFactors = FALSE ) } else if (grepl("^(rmanova|WRS2::rmanova)", fcall)) { data.frame( - "F" = model$test, - "df" = model$df1, - "df_error" = model$df2, - "p" = model$p.value, - "Method" = "A heteroscedastic one-way repeated measures ANOVA for trimmed means", + `F` = model$test, + df = model$df1, + df_error = model$df2, + p = model$p.value, + Method = "A heteroscedastic one-way repeated measures ANOVA for trimmed means", stringsAsFactors = FALSE ) } } -#' @rdname model_parameters.averaging + #' @export model_parameters.med1way <- function(model, verbose = TRUE, ...) { parameters <- .extract_wrs2_med1way(model) @@ -62,15 +61,14 @@ model_parameters.med1way <- function(model, verbose = TRUE, ...) { .extract_wrs2_med1way <- function(model) { data.frame( - "F" = model$test, - "Critical value" = model$crit.val, - "p" = model$p.value, - "Method" = "Heteroscedastic one-way ANOVA for medians", + `F` = model$test, + `Critical value` = model$crit.val, + p = model$p.value, + Method = "Heteroscedastic one-way ANOVA for medians", stringsAsFactors = FALSE ) } -#' @rdname model_parameters.averaging #' @export model_parameters.dep.effect <- function(model, keep = NULL, @@ -123,7 +121,6 @@ model_parameters.dep.effect <- function(model, # t-test ---------------------- -#' @rdname model_parameters.averaging #' @export model_parameters.yuen <- function(model, verbose = TRUE, ...) { parameters <- .extract_wrs2_yuen(model) @@ -141,31 +138,31 @@ model_parameters.yuen <- function(model, verbose = TRUE, ...) { if (grepl("^(yuen\\(|WRS2::yuen\\()", fcall) || grepl("function (formula, data, tr = 0.2, ...)", fcall, fixed = TRUE)) { out <- data.frame( - "t" = model$test, - "df_error" = model$df, - "p" = model$p.value, - "Method" = "Yuen's test on trimmed means for independent samples", - "Difference" = model$diff, - "CI" = 0.95, - "Difference_CI_low" = model$conf.int[1], - "Difference_CI_high" = model$conf.int[2], - "Estimate" = model$effsize, - "Effectsize" = "Explanatory measure of effect size", + t = model$test, + df_error = model$df, + p = model$p.value, + Method = "Yuen's test on trimmed means for independent samples", + Difference = model$diff, + CI = 0.95, + Difference_CI_low = model$conf.int[1], + Difference_CI_high = model$conf.int[2], + Estimate = model$effsize, + Effectsize = "Explanatory measure of effect size", stringsAsFactors = FALSE ) } else { # within-subjects out <- data.frame( - "t" = model$test, - "df_error" = model$df, - "p" = model$p.value, - "Method" = "Yuen's test on trimmed means for dependent samples", - "Difference" = model$diff, - "CI" = 0.95, - "Difference_CI_low" = model$conf.int[1], - "Difference_CI_high" = model$conf.int[2], - "Estimate" = model$effsize, - "Effectsize" = "Explanatory measure of effect size", + t = model$test, + df_error = model$df, + p = model$p.value, + Method = "Yuen's test on trimmed means for dependent samples", + Difference = model$diff, + CI = 0.95, + Difference_CI_low = model$conf.int[1], + Difference_CI_high = model$conf.int[2], + Estimate = model$effsize, + Effectsize = "Explanatory measure of effect size", stringsAsFactors = FALSE ) } @@ -256,14 +253,14 @@ model_parameters.onesampb <- function(model, verbose = TRUE, ...) { .extract_wrs2_onesampb <- function(model) { data.frame( - "Estimate" = model$estimate, - "CI" = 1 - model$alpha, - "CI_low" = model$ci[1], - "CI_high" = model$ci[2], - "p" = model$p.value, - "n_Obs" = model$n, - "Effectsize" = "Robust location measure", - "Method" = "One-sample percentile bootstrap", + Estimate = model$estimate, + CI = 1 - model$alpha, + CI_low = model$ci[1], + CI_high = model$ci[2], + p = model$p.value, + n_Obs = model$n, + Effectsize = "Robust location measure", + Method = "One-sample percentile bootstrap", stringsAsFactors = FALSE ) } @@ -278,15 +275,15 @@ model_parameters.trimcibt <- function(model, verbose = TRUE, ...) { .extract_wrs2_trimcibt <- function(model) { data.frame( - "t" = model$test.stat, - "p" = model$p.value, - "n_Obs" = model$n, - "Method" = "Bootstrap-t method for one-sample test", - "Estimate" = model$estimate[[1]], - "CI" = 1 - model$alpha, - "CI_low" = model$ci[1], - "CI_high" = model$ci[2], - "Effectsize" = "Trimmed mean", + t = model$test.stat, + p = model$p.value, + n_Obs = model$n, + Method = "Bootstrap-t method for one-sample test", + Estimate = model$estimate[[1]], + CI = 1 - model$alpha, + CI_low = model$ci[1], + CI_high = model$ci[2], + Effectsize = "Trimmed mean", stringsAsFactors = FALSE ) } @@ -304,11 +301,11 @@ model_parameters.AKP <- function(model, verbose = TRUE, ...) { .extract_wrs2_AKP <- function(model) { data.frame( - "Estimate" = model$AKPeffect, - "CI" = 1 - model$alpha, - "CI_low" = model$AKPci[1], - "CI_high" = model$AKPci[2], - "Effectsize" = "Algina-Keselman-Penfield robust standardized difference", + Estimate = model$AKPeffect, + CI = 1 - model$alpha, + CI_low = model$AKPci[1], + CI_high = model$AKPci[2], + Effectsize = "Algina-Keselman-Penfield robust standardized difference", stringsAsFactors = FALSE ) } @@ -322,11 +319,11 @@ model_parameters.wmcpAKP <- function(model, verbose = TRUE, ...) { .extract_wrs2_wmcpAKP <- function(model) { data.frame( - "Estimate" = model[[1]], - "CI" = 0.95, - "CI_low" = model[[2]], - "CI_high" = model[[3]], - "Effectsize" = "Algina-Keselman-Penfield robust standardized difference average", + Estimate = model[[1]], + CI = 0.95, + CI_low = model[[2]], + CI_high = model[[3]], + Effectsize = "Algina-Keselman-Penfield robust standardized difference average", stringsAsFactors = FALSE ) } diff --git a/_pkgdown.yml b/_pkgdown.yml index 8bd1a468b..a6fef29f8 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -14,7 +14,7 @@ reference: - model_parameters.befa - model_parameters.default - model_parameters.zcpglm - - model_parameters.gam + - model_parameters.cgam - model_parameters.mlm - model_parameters.merMod - model_parameters.lavaan diff --git a/man/model_parameters.aov.Rd b/man/model_parameters.aov.Rd index a4e8fec13..ab2aba594 100644 --- a/man/model_parameters.aov.Rd +++ b/man/model_parameters.aov.Rd @@ -2,12 +2,7 @@ % Please edit documentation in R/methods_aov.R \name{model_parameters.aov} \alias{model_parameters.aov} -\alias{model_parameters.anova} -\alias{model_parameters.aovlist} \alias{model_parameters.afex_aov} -\alias{model_parameters.anova.rms} -\alias{model_parameters.Anova.mlm} -\alias{model_parameters.maov} \title{Parameters from ANOVAs} \usage{ \method{model_parameters}{aov}( @@ -29,44 +24,6 @@ ... ) -\method{model_parameters}{anova}( - model, - type = NULL, - df_error = NULL, - ci = NULL, - alternative = NULL, - test = NULL, - power = FALSE, - effectsize_type = NULL, - keep = NULL, - drop = NULL, - table_wide = FALSE, - verbose = TRUE, - omega_squared = NULL, - eta_squared = NULL, - epsilon_squared = NULL, - ... -) - -\method{model_parameters}{aovlist}( - model, - type = NULL, - df_error = NULL, - ci = NULL, - alternative = NULL, - test = NULL, - power = FALSE, - effectsize_type = NULL, - keep = NULL, - drop = NULL, - table_wide = FALSE, - verbose = TRUE, - omega_squared = NULL, - eta_squared = NULL, - epsilon_squared = NULL, - ... -) - \method{model_parameters}{afex_aov}( model, effectsize_type = NULL, @@ -77,63 +34,6 @@ verbose = TRUE, ... ) - -\method{model_parameters}{anova.rms}( - model, - type = NULL, - df_error = NULL, - ci = NULL, - alternative = NULL, - test = NULL, - power = FALSE, - effectsize_type = NULL, - keep = NULL, - drop = NULL, - table_wide = FALSE, - verbose = TRUE, - omega_squared = NULL, - eta_squared = NULL, - epsilon_squared = NULL, - ... -) - -\method{model_parameters}{Anova.mlm}( - model, - type = NULL, - df_error = NULL, - ci = NULL, - alternative = NULL, - test = NULL, - power = FALSE, - effectsize_type = NULL, - keep = NULL, - drop = NULL, - table_wide = FALSE, - verbose = TRUE, - omega_squared = NULL, - eta_squared = NULL, - epsilon_squared = NULL, - ... -) - -\method{model_parameters}{maov}( - model, - type = NULL, - df_error = NULL, - ci = NULL, - alternative = NULL, - test = NULL, - power = FALSE, - effectsize_type = NULL, - keep = NULL, - drop = NULL, - table_wide = FALSE, - verbose = TRUE, - omega_squared = NULL, - eta_squared = NULL, - epsilon_squared = NULL, - ... -) } \arguments{ \item{model}{Object of class \code{\link[=aov]{aov()}}, \code{\link[=anova]{anova()}}, diff --git a/man/model_parameters.averaging.Rd b/man/model_parameters.averaging.Rd index 091d97fd9..19febea6f 100644 --- a/man/model_parameters.averaging.Rd +++ b/man/model_parameters.averaging.Rd @@ -1,79 +1,34 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/methods_PMCMRplus.R, R/methods_aod.R, -% R/methods_averaging.R, R/methods_bbmle.R, R/methods_betareg.R, -% R/methods_bfsl.R, R/methods_car.R, R/methods_emmeans.R, -% R/methods_epi2x2.R, R/methods_fitdistr.R, R/methods_ggeffects.R, -% R/methods_gjrm.R, R/methods_glmm.R, R/methods_glmx.R, R/methods_ivfixed.R, -% R/methods_ivprobit.R, R/methods_lmodel2.R, R/methods_logistf.R, -% R/methods_lqmm.R, R/methods_marginaleffects.R, R/methods_margins.R, -% R/methods_maxLik.R, R/methods_mediate.R, R/methods_metaplus.R, -% R/methods_mfx.R, R/methods_mjoint.R, R/methods_model_fit.R, -% R/methods_multcomp.R, R/methods_mvord.R, R/methods_plm.R, -% R/methods_quantreg.R, R/methods_selection.R, R/methods_stats4.R, -% R/methods_systemfit.R, R/methods_varest.R, R/methods_wrs2.R -\name{model_parameters.PMCMR} -\alias{model_parameters.PMCMR} +% Please edit documentation in R/methods_aod.R, R/methods_averaging.R, +% R/methods_betareg.R, R/methods_bfsl.R, R/methods_car.R, R/methods_emmeans.R, +% R/methods_ggeffects.R, R/methods_glmm.R, R/methods_glmx.R, R/methods_lqmm.R, +% R/methods_marginaleffects.R, R/methods_metaplus.R, R/methods_mfx.R, +% R/methods_mjoint.R, R/methods_model_fit.R, R/methods_mvord.R, +% R/methods_plm.R, R/methods_selection.R +\name{model_parameters.glimML} \alias{model_parameters.glimML} \alias{model_parameters.averaging} -\alias{model_parameters.mle2} \alias{model_parameters.betareg} \alias{model_parameters.bfsl} \alias{model_parameters.deltaMethod} -\alias{model_parameters.emmGrid} \alias{model_parameters.emm_list} -\alias{model_parameters.epi.2by2} -\alias{model_parameters.fitdistr} \alias{model_parameters.ggeffects} -\alias{model_parameters.SemiParBIV} \alias{model_parameters.glmm} \alias{model_parameters.glmx} -\alias{model_parameters.ivFixed} -\alias{model_parameters.ivprobit} -\alias{model_parameters.lmodel2} -\alias{model_parameters.logistf} \alias{model_parameters.lqmm} \alias{model_parameters.marginaleffects} -\alias{model_parameters.comparisons} -\alias{model_parameters.marginalmeans} -\alias{model_parameters.hypotheses} -\alias{model_parameters.slopes} -\alias{model_parameters.predictions} -\alias{model_parameters.margins} -\alias{model_parameters.maxLik} -\alias{model_parameters.maxim} -\alias{model_parameters.mediate} \alias{model_parameters.metaplus} \alias{model_parameters.meta_random} -\alias{model_parameters.meta_fixed} \alias{model_parameters.meta_bma} -\alias{model_parameters.logitor} -\alias{model_parameters.poissonirr} -\alias{model_parameters.negbinirr} -\alias{model_parameters.poissonmfx} -\alias{model_parameters.logitmfx} -\alias{model_parameters.probitmfx} -\alias{model_parameters.negbinmfx} \alias{model_parameters.betaor} \alias{model_parameters.betamfx} \alias{model_parameters.mjoint} \alias{model_parameters.model_fit} -\alias{model_parameters.glht} \alias{model_parameters.mvord} \alias{model_parameters.pgmm} -\alias{model_parameters.rqss} -\alias{model_parameters.rqs} \alias{model_parameters.selection} -\alias{model_parameters.mle} -\alias{model_parameters.systemfit} -\alias{model_parameters.varest} -\alias{model_parameters.t1way} -\alias{model_parameters.med1way} -\alias{model_parameters.dep.effect} -\alias{model_parameters.yuen} \title{Parameters from special models} \usage{ -\method{model_parameters}{PMCMR}(model, ...) - \method{model_parameters}{glimML}( model, ci = 0.95, @@ -103,24 +58,6 @@ ... ) -\method{model_parameters}{mle2}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - vcov = NULL, - vcov_args = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{betareg}( model, ci = 0.95, @@ -151,23 +88,6 @@ \method{model_parameters}{deltaMethod}(model, p_adjust = NULL, verbose = TRUE, ...) -\method{model_parameters}{emmGrid}( - model, - ci = 0.95, - centrality = "median", - dispersion = FALSE, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{emm_list}( model, ci = 0.95, @@ -177,26 +97,8 @@ ... ) -\method{model_parameters}{epi.2by2}(model, verbose = TRUE, ...) - -\method{model_parameters}{fitdistr}(model, exponentiate = FALSE, verbose = TRUE, ...) - \method{model_parameters}{ggeffects}(model, keep = NULL, drop = NULL, verbose = TRUE, ...) -\method{model_parameters}{SemiParBIV}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{glmm}( model, ci = 0.95, @@ -226,55 +128,6 @@ ... ) -\method{model_parameters}{ivFixed}( - model, - ci = 0.95, - ci_method = "wald", - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{ivprobit}( - model, - ci = 0.95, - ci_method = "wald", - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{lmodel2}( - model, - ci = 0.95, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{logistf}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - vcov = NULL, - vcov_args = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{lqmm}( model, ci = 0.95, @@ -287,63 +140,6 @@ \method{model_parameters}{marginaleffects}(model, ci = 0.95, exponentiate = FALSE, ...) -\method{model_parameters}{comparisons}(model, ci = 0.95, exponentiate = FALSE, ...) - -\method{model_parameters}{marginalmeans}(model, ci = 0.95, exponentiate = FALSE, ...) - -\method{model_parameters}{hypotheses}(model, ci = 0.95, exponentiate = FALSE, ...) - -\method{model_parameters}{slopes}(model, ci = 0.95, exponentiate = FALSE, ...) - -\method{model_parameters}{predictions}(model, ci = 0.95, exponentiate = TRUE, ...) - -\method{model_parameters}{margins}( - model, - ci = 0.95, - exponentiate = FALSE, - p_adjust = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{maxLik}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - verbose = TRUE, - vcov = NULL, - vcov_args = NULL, - ... -) - -\method{model_parameters}{maxim}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - verbose = TRUE, - vcov = NULL, - vcov_args = NULL, - ... -) - -\method{model_parameters}{mediate}(model, ci = 0.95, exponentiate = FALSE, verbose = TRUE, ...) - \method{model_parameters}{metaplus}( model, ci = 0.95, @@ -368,16 +164,6 @@ ... ) -\method{model_parameters}{meta_fixed}( - model, - ci = 0.95, - ci_method = "eti", - exponentiate = FALSE, - include_studies = TRUE, - verbose = TRUE, - ... -) - \method{model_parameters}{meta_bma}( model, ci = 0.95, @@ -388,102 +174,6 @@ ... ) -\method{model_parameters}{logitor}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = TRUE, - p_adjust = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{poissonirr}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = TRUE, - p_adjust = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{negbinirr}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = TRUE, - p_adjust = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{poissonmfx}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "marginal"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{logitmfx}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "marginal"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{probitmfx}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "marginal"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{negbinmfx}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "marginal"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{betaor}( model, ci = 0.95, @@ -540,16 +230,6 @@ ... ) -\method{model_parameters}{glht}( - model, - ci = 0.95, - exponentiate = FALSE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{mvord}( model, ci = 0.95, @@ -576,35 +256,6 @@ ... ) -\method{model_parameters}{rqss}( - model, - ci = 0.95, - ci_method = "residual", - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{rqs}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{selection}( model, ci = 0.95, @@ -620,65 +271,9 @@ verbose = TRUE, ... ) - -\method{model_parameters}{mle}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - vcov = NULL, - vcov_args = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{systemfit}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = FALSE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{varest}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{t1way}(model, keep = NULL, verbose = TRUE, ...) - -\method{model_parameters}{med1way}(model, verbose = TRUE, ...) - -\method{model_parameters}{dep.effect}(model, keep = NULL, verbose = TRUE, ...) - -\method{model_parameters}{yuen}(model, verbose = TRUE, ...) } \arguments{ -\item{model}{Object from \code{WRS2} package.} - -\item{...}{Arguments passed to or from other methods.} +\item{model}{Model object.} \item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).} @@ -759,6 +354,10 @@ names.} \item{verbose}{Toggle warnings and messages.} +\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()}.} + \item{ci_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"}, @@ -769,54 +368,6 @@ options (which vary depending on the model class): \code{"residual"}, \code{\link[=model_parameters]{model_parameters()}} for further details. When \code{ci_method=NULL}, in most cases \code{"wald"} is used then.} -\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{centrality}{The point-estimates (centrality indices) to compute. Character -(vector) or list with one or more of these options: \code{"median"}, \code{"mean"}, \code{"MAP"} -(see \code{\link[bayestestR:map_estimate]{map_estimate()}}), \code{"trimmed"} (which is just \code{mean(x, trim = threshold)}), -\code{"mode"} or \code{"all"}.} - -\item{dispersion}{Logical, if \code{TRUE}, computes indices of dispersion related -to the estimate(s) (\code{SD} and \code{MAD} for \code{mean} and \code{median}, respectively). -Dispersion is not available for \code{"MAP"} or \code{"mode"} centrality indices.} - -\item{test}{The indices of effect existence to compute. Character (vector) or -list with one or more of these options: \code{"p_direction"} (or \code{"pd"}), -\code{"rope"}, \code{"p_map"}, \code{"equivalence_test"} (or \code{"equitest"}), -\code{"bayesfactor"} (or \code{"bf"}) or \code{"all"} to compute all tests. -For each "test", the corresponding \pkg{bayestestR} function is called -(e.g. \code{\link[bayestestR:rope]{rope()}} or \code{\link[bayestestR:p_direction]{p_direction()}}) and its results -included in the summary output.} - -\item{rope_range}{ROPE's lower and higher bounds. Should be a list of two -values (e.g., \code{c(-0.1, 0.1)}) or \code{"default"}. If \code{"default"}, -the bounds are set to \code{x +- 0.1*SD(response)}.} - -\item{rope_ci}{The Credible Interval (CI) probability, corresponding to the -proportion of HDI, to use for the percentage in ROPE.} - \item{effects}{Should results for fixed effects, random effects or both be returned? Only applies to mixed models. May be abbreviated.} @@ -824,16 +375,10 @@ returned? Only applies to mixed models. May be abbreviated.} for all studies. Else, only parameters for overall-effects are shown.} } \value{ -A data frame of indices related to the model's parameters. - -A data frame of indices related to the model's parameters. - A data frame of indices related to the model's parameters. } \description{ Parameters from special regression models not listed under one of the previous categories yet. - -Parameters from Hypothesis Testing. } \examples{ library(parameters) @@ -847,33 +392,6 @@ if (require("brglm2", quietly = TRUE)) { ) model_parameters(model) } -\donttest{ -if (require("multcomp", quietly = TRUE)) { - # multiple linear model, swiss data - lmod <- lm(Fertility ~ ., data = swiss) - mod <- glht( - model = lmod, - linfct = c( - "Agriculture = 0", - "Examination = 0", - "Education = 0", - "Catholic = 0", - "Infant.Mortality = 0" - ) - ) - model_parameters(mod) -} -if (require("PMCMRplus", quietly = TRUE)) { - model <- suppressWarnings( - kwAllPairsConoverTest(count ~ spray, data = InsectSprays) - ) - model_parameters(model) -} -} -if (require("WRS2") && packageVersion("WRS2") >= "1.1.3") { - model <- t1way(libido ~ dose, data = viagra) - model_parameters(model) -} } \seealso{ \code{\link[insight:standardize_names]{insight::standardize_names()}} to rename diff --git a/man/model_parameters.cgam.Rd b/man/model_parameters.cgam.Rd index 8744ca6cf..90a5ff164 100644 --- a/man/model_parameters.cgam.Rd +++ b/man/model_parameters.cgam.Rd @@ -1,15 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/methods_cgam.R, R/methods_gam.R, -% R/methods_gamlss.R, R/methods_mgcv.R, R/methods_other.R, R/methods_scam.R, -% R/methods_vgam.R +% Please edit documentation in R/methods_cgam.R, R/methods_mgcv.R, +% R/methods_other.R, R/methods_scam.R \name{model_parameters.cgam} \alias{model_parameters.cgam} -\alias{model_parameters.gam} -\alias{model_parameters.gamlss} \alias{model_parameters.gamm} \alias{model_parameters.Gam} \alias{model_parameters.scam} -\alias{model_parameters.vgam} \title{Parameters from Generalized Additive (Mixed) Models} \usage{ \method{model_parameters}{cgam}( @@ -27,36 +23,6 @@ ... ) -\method{model_parameters}{gam}( - model, - ci = 0.95, - ci_method = "residual", - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{gamlss}( - model, - ci = 0.95, - ci_method = "residual", - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{gamm}( model, ci = 0.95, @@ -90,21 +56,6 @@ verbose = TRUE, ... ) - -\method{model_parameters}{vgam}( - model, - ci = 0.95, - ci_method = "residual", - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) } \arguments{ \item{model}{A gam/gamm model.} diff --git a/man/model_parameters.default.Rd b/man/model_parameters.default.Rd index 7684b34a1..2a2ccec29 100644 --- a/man/model_parameters.default.Rd +++ b/man/model_parameters.default.Rd @@ -6,8 +6,6 @@ \alias{model_parameters.glm} \alias{model_parameters.censReg} \alias{model_parameters.ridgelm} -\alias{model_parameters.polr} -\alias{model_parameters.negbin} \title{Parameters from (General) Linear Models} \usage{ \method{model_parameters}{default}( @@ -65,42 +63,6 @@ ) \method{model_parameters}{ridgelm}(model, verbose = TRUE, ...) - -\method{model_parameters}{polr}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - vcov = NULL, - vcov_args = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{negbin}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - vcov = NULL, - vcov_args = NULL, - verbose = TRUE, - ... -) } \arguments{ \item{model}{Model object.} diff --git a/man/model_parameters.glht.Rd b/man/model_parameters.glht.Rd new file mode 100644 index 000000000..9ac52abde --- /dev/null +++ b/man/model_parameters.glht.Rd @@ -0,0 +1,94 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/methods_multcomp.R +\name{model_parameters.glht} +\alias{model_parameters.glht} +\title{Parameters from Hypothesis Testing} +\usage{ +\method{model_parameters}{glht}( + model, + ci = 0.95, + exponentiate = FALSE, + keep = NULL, + drop = NULL, + verbose = TRUE, + ... +) +} +\arguments{ +\item{model}{Object of class \code{\link[multcomp:glht]{multcomp::glht()}} (\strong{multcomp}) +or of class \code{PMCMR}, \code{trendPMCMR} or \code{osrt} (\strong{PMCMRplus}).} + +\item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).} + +\item{exponentiate}{Logical, indicating whether or not to exponentiate the +coefficients (and related confidence intervals). This is typical for +logistic regression, or more generally speaking, for models with log or +logit links. It is also recommended to use \code{exponentiate = TRUE} for models +with log-transformed response values. \strong{Note:} Delta-method standard +errors are also computed (by multiplying the standard errors by the +transformed coefficients). This is to mimic behaviour of other software +packages, such as Stata, but these standard errors poorly estimate +uncertainty for the transformed coefficient. The transformed confidence +interval more clearly captures this uncertainty. For \code{compare_parameters()}, +\code{exponentiate = "nongaussian"} will only exponentiate coefficients from +non-Gaussian families.} + +\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 +named list of regular expressions. All non-matching parameters will be +removed from the output. If \code{keep} is a character vector, every parameter +name in the \emph{"Parameter"} column that matches the regular expression in +\code{keep} will be selected from the returned data frame (and vice versa, +all parameter names matching \code{drop} will be excluded). Furthermore, if +\code{keep} has more than one element, these will be merged with an \code{OR} +operator into a regular expression pattern like this: \code{"(one|two|three)"}. +If \code{keep} is a named list of regular expression patterns, the names of the +list-element should equal the column name where selection should be +applied. This is useful for model objects where \code{model_parameters()} +returns multiple columns with parameter components, like in +\code{\link[=model_parameters.lavaan]{model_parameters.lavaan()}}. Note that the regular expression pattern +should match the parameter names as they are stored in the returned data +frame, which can be different from how they are printed. Inspect the +\verb{$Parameter} column of the parameters table to get the exact parameter +names.} + +\item{drop}{See \code{keep}.} + +\item{verbose}{Toggle warnings and messages.} + +\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()}.} +} +\value{ +A data frame of indices related to the model's parameters. +} +\description{ +Parameters from Hypothesis Testing. +} +\examples{ +\donttest{ +if (require("multcomp", quietly = TRUE)) { + # multiple linear model, swiss data + lmod <- lm(Fertility ~ ., data = swiss) + mod <- glht( + model = lmod, + linfct = c( + "Agriculture = 0", + "Examination = 0", + "Education = 0", + "Catholic = 0", + "Infant.Mortality = 0" + ) + ) + model_parameters(mod) +} +if (require("PMCMRplus", quietly = TRUE)) { + model <- suppressWarnings( + kwAllPairsConoverTest(count ~ spray, data = InsectSprays) + ) + model_parameters(model) +} +} +} diff --git a/man/model_parameters.principal.Rd b/man/model_parameters.principal.Rd index 156b2031e..0d71c3af6 100644 --- a/man/model_parameters.principal.Rd +++ b/man/model_parameters.principal.Rd @@ -1,13 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/methods_FactoMineR.R, R/methods_lavaan.R, -% R/methods_psych.R, R/methods_sem.R +% R/methods_psych.R \name{model_parameters.PCA} \alias{model_parameters.PCA} -\alias{model_parameters.FAMD} \alias{model_parameters.lavaan} \alias{model_parameters.principal} -\alias{model_parameters.omega} -\alias{model_parameters.sem} \title{Parameters from PCA, FA, CFA, SEM} \usage{ \method{model_parameters}{PCA}( @@ -19,15 +16,6 @@ ... ) -\method{model_parameters}{FAMD}( - model, - sort = FALSE, - threshold = NULL, - labels = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{lavaan}( model, ci = 0.95, @@ -47,26 +35,6 @@ verbose = TRUE, ... ) - -\method{model_parameters}{omega}(model, verbose = TRUE, ...) - -\method{model_parameters}{sem}( - model, - ci = 0.95, - ci_method = NULL, - bootstrap = FALSE, - iterations = 1000, - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - summary = getOption("parameters_summary", FALSE), - keep = NULL, - drop = NULL, - verbose = TRUE, - vcov = NULL, - vcov_args = NULL, - ... -) } \arguments{ \item{model}{Model object.} @@ -121,70 +89,6 @@ frame, which can be different from how they are printed. Inspect the names.} \item{drop}{See \code{keep}.} - -\item{ci_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. When \code{ci_method=NULL}, in most -cases \code{"wald"} is used then.} - -\item{bootstrap}{Should estimates be based on bootstrapped model? If -\code{TRUE}, then arguments of \link[=model_parameters.stanreg]{Bayesian regressions} apply (see also -\code{\link[=bootstrap_parameters]{bootstrap_parameters()}}).} - -\item{iterations}{The number of bootstrap replicates. This only apply in the -case of bootstrapped frequentist models.} - -\item{exponentiate}{Logical, indicating whether or not to exponentiate the -coefficients (and related confidence intervals). This is typical for -logistic regression, or more generally speaking, for models with log or -logit links. It is also recommended to use \code{exponentiate = TRUE} for models -with log-transformed response values. \strong{Note:} Delta-method standard -errors are also computed (by multiplying the standard errors by the -transformed coefficients). This is to mimic behaviour of other software -packages, such as Stata, but these standard errors poorly estimate -uncertainty for the transformed coefficient. The transformed confidence -interval more clearly captures this uncertainty. For \code{compare_parameters()}, -\code{exponentiate = "nongaussian"} will only exponentiate coefficients from -non-Gaussian families.} - -\item{p_adjust}{Character vector, if not \code{NULL}, indicates the method to -adjust p-values. See \code{\link[stats:p.adjust]{stats::p.adjust()}} for details. Further -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}{Logical, if \code{TRUE}, prints summary information about the -model (model formula, number of observations, residual standard deviation -and more).} - -\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.} } \value{ A data frame of indices or loadings. diff --git a/man/model_parameters.stanreg.Rd b/man/model_parameters.stanreg.Rd index 0e48b8f07..3ddf369ad 100644 --- a/man/model_parameters.stanreg.Rd +++ b/man/model_parameters.stanreg.Rd @@ -1,17 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/methods_MCMCglmm.R, R/methods_bamlss.R, -% R/methods_base.R, R/methods_bayesQR.R, R/methods_brms.R, R/methods_coda.R, -% R/methods_cplm.R, R/methods_lrm.R, R/methods_posterior.R, R/methods_rstan.R, -% R/methods_rstanarm.R +% Please edit documentation in R/methods_MCMCglmm.R, R/methods_base.R, +% R/methods_brms.R, R/methods_coda.R, R/methods_posterior.R, +% R/methods_rstan.R, R/methods_rstanarm.R \name{model_parameters.MCMCglmm} \alias{model_parameters.MCMCglmm} -\alias{model_parameters.bamlss} \alias{model_parameters.data.frame} -\alias{model_parameters.bayesQR} \alias{model_parameters.brmsfit} \alias{model_parameters.mcmc.list} -\alias{model_parameters.bcplm} -\alias{model_parameters.blrm} \alias{model_parameters.draws} \alias{model_parameters.stanfit} \alias{model_parameters.stanreg} @@ -35,44 +30,8 @@ ... ) -\method{model_parameters}{bamlss}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - component = "all", - exponentiate = FALSE, - standardize = NULL, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{data.frame}(model, as_draws = FALSE, verbose = TRUE, ...) -\method{model_parameters}{bayesQR}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - bf_prior = NULL, - diagnostic = c("ESS", "Rhat"), - priors = TRUE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{brmsfit}( model, centrality = "median", @@ -98,42 +57,6 @@ \method{model_parameters}{mcmc.list}(model, as_draws = FALSE, verbose = TRUE, ...) -\method{model_parameters}{bcplm}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - bf_prior = NULL, - diagnostic = c("ESS", "Rhat"), - priors = TRUE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{blrm}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - bf_prior = NULL, - diagnostic = c("ESS", "Rhat"), - priors = TRUE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{draws}( model, centrality = "median", @@ -268,6 +191,14 @@ names.} \item{...}{Currently not used.} +\item{as_draws}{Logical, if \code{TRUE} and \code{model} is of class \code{data.frame}, +the data frame is treated as posterior samples and handled similar to +Bayesian models. All arguments in \code{...} are passed to +\code{model_parameters.draws()}.} + +\item{effects}{Should results for fixed effects, random effects or both be +returned? Only applies to mixed models. May be abbreviated.} + \item{component}{Which type of parameters to return, such as parameters for the conditional model, the zero-inflation part of the model, the dispersion term, or other auxiliary parameters be returned? Applies to models with @@ -312,14 +243,6 @@ effects will be standardized. standardized parameters only works when \code{standardize="refit"}. }} -\item{as_draws}{Logical, if \code{TRUE} and \code{model} is of class \code{data.frame}, -the data frame is treated as posterior samples and handled similar to -Bayesian models. All arguments in \code{...} are passed to -\code{model_parameters.draws()}.} - -\item{effects}{Should results for fixed effects, random effects or both be -returned? Only applies to mixed models. May be abbreviated.} - \item{group_level}{Logical, for multilevel models (i.e. models with random effects) and when \code{effects = "all"} or \code{effects = "random"}, include the parameters for each group level from random effects. If diff --git a/man/model_parameters.t1way.Rd b/man/model_parameters.t1way.Rd new file mode 100644 index 000000000..57c3ae5c8 --- /dev/null +++ b/man/model_parameters.t1way.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/methods_wrs2.R +\name{model_parameters.t1way} +\alias{model_parameters.t1way} +\title{Parameters from robust statistical objects in \code{WRS2}} +\usage{ +\method{model_parameters}{t1way}(model, keep = NULL, verbose = TRUE, ...) +} +\arguments{ +\item{model}{Object from \code{WRS2} package.} + +\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 +named list of regular expressions. All non-matching parameters will be +removed from the output. If \code{keep} is a character vector, every parameter +name in the \emph{"Parameter"} column that matches the regular expression in +\code{keep} will be selected from the returned data frame (and vice versa, +all parameter names matching \code{drop} will be excluded). Furthermore, if +\code{keep} has more than one element, these will be merged with an \code{OR} +operator into a regular expression pattern like this: \code{"(one|two|three)"}. +If \code{keep} is a named list of regular expression patterns, the names of the +list-element should equal the column name where selection should be +applied. This is useful for model objects where \code{model_parameters()} +returns multiple columns with parameter components, like in +\code{\link[=model_parameters.lavaan]{model_parameters.lavaan()}}. Note that the regular expression pattern +should match the parameter names as they are stored in the returned data +frame, which can be different from how they are printed. Inspect the +\verb{$Parameter} column of the parameters table to get the exact parameter +names.} + +\item{verbose}{Toggle warnings and messages.} + +\item{...}{Arguments passed to or from other methods.} +} +\value{ +A data frame of indices related to the model's parameters. +} +\description{ +Parameters from robust statistical objects in \code{WRS2} +} +\examples{ +if (require("WRS2") && packageVersion("WRS2") >= "1.1.3") { + model <- t1way(libido ~ dose, data = viagra) + model_parameters(model) +} +} diff --git a/man/model_parameters.zcpglm.Rd b/man/model_parameters.zcpglm.Rd index af636541f..c277b50c3 100644 --- a/man/model_parameters.zcpglm.Rd +++ b/man/model_parameters.zcpglm.Rd @@ -1,12 +1,8 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/methods_cplm.R, R/methods_mhurdle.R, -% R/methods_pscl.R +% Please edit documentation in R/methods_cplm.R, R/methods_mhurdle.R \name{model_parameters.zcpglm} \alias{model_parameters.zcpglm} \alias{model_parameters.mhurdle} -\alias{model_parameters.zeroinfl} -\alias{model_parameters.hurdle} -\alias{model_parameters.zerocount} \title{Parameters from Zero-Inflated Models} \usage{ \method{model_parameters}{zcpglm}( @@ -37,54 +33,6 @@ verbose = TRUE, ... ) - -\method{model_parameters}{zeroinfl}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "zi", "zero_inflated"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - summary = getOption("parameters_summary", FALSE), - verbose = TRUE, - ... -) - -\method{model_parameters}{hurdle}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "zi", "zero_inflated"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - summary = getOption("parameters_summary", FALSE), - verbose = TRUE, - ... -) - -\method{model_parameters}{zerocount}( - model, - ci = 0.95, - bootstrap = FALSE, - iterations = 1000, - component = c("all", "conditional", "zi", "zero_inflated"), - standardize = NULL, - exponentiate = FALSE, - p_adjust = NULL, - keep = NULL, - drop = NULL, - summary = getOption("parameters_summary", FALSE), - verbose = TRUE, - ... -) } \arguments{ \item{model}{A model with zero-inflation component.}