From 1b8ea08aff796862641d0f6537bfd5000d591776 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 09:18:28 +0100 Subject: [PATCH 01/13] Logistic models: Be less verbose by default + be less scary for users with less red Fixes #1034 --- R/format.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/format.R b/R/format.R index 517c02600..99027e42c 100644 --- a/R/format.R +++ b/R/format.R @@ -853,7 +853,7 @@ format.parameters_sem <- function(x, msg <- paste(msg, "Uncertainty intervals for random effect variances computed using a Wald z-distribution approximation.") # nolint } - insight::format_alert(msg) + insight::format_alert(insight::color_text(msg, "yellow")) } } } From a21a5c9415a3dfb2e72ca4b0cb51a5caeb91cf5a Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 09:21:03 +0100 Subject: [PATCH 02/13] model info --- R/format.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/format.R b/R/format.R index 99027e42c..844bb3948 100644 --- a/R/format.R +++ b/R/format.R @@ -615,7 +615,7 @@ format.parameters_sem <- function(x, # add color code, if we have a footer if (!is.null(footer) && type == "text") { - footer <- c(footer, "blue") + footer <- c(footer, "yellow") } # if we have two trailing newlines, remove one From db6dbb60f31a3d7e03c041f29eed3054489d6a74 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 09:35:33 +0100 Subject: [PATCH 03/13] no color --- R/format.R | 5 ----- 1 file changed, 5 deletions(-) diff --git a/R/format.R b/R/format.R index 844bb3948..4edec7956 100644 --- a/R/format.R +++ b/R/format.R @@ -613,11 +613,6 @@ format.parameters_sem <- function(x, footer <- .add_footer_text(footer, footer_text, type, is_ggeffects) } - # add color code, if we have a footer - if (!is.null(footer) && type == "text") { - footer <- c(footer, "yellow") - } - # if we have two trailing newlines, remove one if (identical(type, "text") && !is.null(footer) && endsWith(footer[1], "\n\n")) { footer[1] <- substr(footer[1], 0, nchar(x) - 1) From 05315e8f06a4c1f894dc5a0db2912937aaa67b9f Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 09:48:36 +0100 Subject: [PATCH 04/13] thresholds --- R/format.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/format.R b/R/format.R index 4edec7956..6aeff9d02 100644 --- a/R/format.R +++ b/R/format.R @@ -880,7 +880,7 @@ format.parameters_sem <- function(x, } } else if (.is_valid_exponentiate_argument(exponentiate) && isTRUE(.additional_arguments(x, "log_response", FALSE))) { # nolint msg <- c( - "This model has a log-transformed response variable, and exponentiated parameters are reported.", + "The model has a log-transformed response variable, and exponentiated parameters are reported.", "A one-unit increase in the predictor is associated with multiplying the outcome by that predictor's coefficient." # nolint ) # don't show warning about complete separation @@ -894,9 +894,9 @@ format.parameters_sem <- function(x, # check for complete separation coefficients or possible issues with # too few data points if (!is.null(spurious_coefficients) && logit_model) { - if (any(spurious_coefficients > 100)) { + if (any(spurious_coefficients > 50)) { msg <- c(msg, "Some coefficients are very large, which may indicate issues with complete separation.") # nolint - } else if (any(spurious_coefficients > 25)) { + } else if (any(spurious_coefficients > 15)) { msg <- c(msg, "Some coefficients seem to be rather large, which may indicate issues with (quasi) complete separation. Consider using bias-corrected or penalized regression models.") # nolint } } From 9a8a204201e2351b0ccc85fe4333537cdc8511ec Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 09:52:03 +0100 Subject: [PATCH 05/13] minor --- R/format.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/format.R b/R/format.R index 6aeff9d02..099e9ca85 100644 --- a/R/format.R +++ b/R/format.R @@ -879,7 +879,7 @@ format.parameters_sem <- function(x, spurious_coefficients <- NULL } } else if (.is_valid_exponentiate_argument(exponentiate) && isTRUE(.additional_arguments(x, "log_response", FALSE))) { # nolint - msg <- c( + msg <- paste( "The model has a log-transformed response variable, and exponentiated parameters are reported.", "A one-unit increase in the predictor is associated with multiplying the outcome by that predictor's coefficient." # nolint ) From af08b90ae3fcb11df79729658f5cc32d125fd277 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 09:56:16 +0100 Subject: [PATCH 06/13] RD --- R/1_model_parameters.R | 2 +- man/model_parameters.averaging.Rd | 2 +- man/model_parameters.cgam.Rd | 2 +- man/model_parameters.default.Rd | 2 +- man/model_parameters.glht.Rd | 2 +- man/model_parameters.htest.Rd | 2 +- man/model_parameters.mlm.Rd | 2 +- man/model_parameters.rma.Rd | 2 +- man/model_parameters.zcpglm.Rd | 2 +- man/n_clusters.Rd | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 13c6e67cd..769656f54 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -504,7 +504,7 @@ parameters <- model_parameters #' - If `s_value = TRUE`, the p-value will be replaced by the S-value in the #' output (cf. _Rafi and Greenland 2020_). #' - `pd` adds an additional column with the _probability of direction_ (see -#' [`bayestestR::p_direction()`] for details). urthermore, see 'Examples' for +#' [`bayestestR::p_direction()`] for details). Furthermore, see 'Examples' for #' this function. #' - For developers, whose interest mainly is to get a "tidy" data frame of #' model summaries, it is recommended to set `pretty_names = FALSE` to speed diff --git a/man/model_parameters.averaging.Rd b/man/model_parameters.averaging.Rd index 8f3ab7f94..fa91a77ee 100644 --- a/man/model_parameters.averaging.Rd +++ b/man/model_parameters.averaging.Rd @@ -298,7 +298,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.cgam.Rd b/man/model_parameters.cgam.Rd index 91b385eb8..e04cbeb3a 100644 --- a/man/model_parameters.cgam.Rd +++ b/man/model_parameters.cgam.Rd @@ -152,7 +152,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.default.Rd b/man/model_parameters.default.Rd index a291af51e..e377fe27c 100644 --- a/man/model_parameters.default.Rd +++ b/man/model_parameters.default.Rd @@ -197,7 +197,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.glht.Rd b/man/model_parameters.glht.Rd index ea52fa1a8..55ded27eb 100644 --- a/man/model_parameters.glht.Rd +++ b/man/model_parameters.glht.Rd @@ -70,7 +70,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.htest.Rd b/man/model_parameters.htest.Rd index 2bc8ffd18..5254ca2ad 100644 --- a/man/model_parameters.htest.Rd +++ b/man/model_parameters.htest.Rd @@ -58,7 +58,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.mlm.Rd b/man/model_parameters.mlm.Rd index 637f81f70..ccc605b36 100644 --- a/man/model_parameters.mlm.Rd +++ b/man/model_parameters.mlm.Rd @@ -166,7 +166,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.rma.Rd b/man/model_parameters.rma.Rd index e552f53d1..39d3d96dd 100644 --- a/man/model_parameters.rma.Rd +++ b/man/model_parameters.rma.Rd @@ -100,7 +100,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/model_parameters.zcpglm.Rd b/man/model_parameters.zcpglm.Rd index e7f4965a6..4ed13d492 100644 --- a/man/model_parameters.zcpglm.Rd +++ b/man/model_parameters.zcpglm.Rd @@ -132,7 +132,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed diff --git a/man/n_clusters.Rd b/man/n_clusters.Rd index 0a7f1561e..8a55f3a01 100644 --- a/man/n_clusters.Rd +++ b/man/n_clusters.Rd @@ -106,7 +106,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed From 871441d4825a91c2496973c81a120d1a1aade10c Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 11:31:03 +0100 Subject: [PATCH 07/13] version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7f260e59e..58394ab64 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: parameters Title: Processing of Model Parameters -Version: 0.23.0.3 +Version: 0.23.0.4 Authors@R: c(person(given = "Daniel", family = "Lüdecke", From 00d20eed6101501ebb8fbb6efad51c776ae088a8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 11:45:50 +0100 Subject: [PATCH 08/13] update tests --- tests/testthat/_snaps/complete_separation.md | 8 ++++---- tests/testthat/_snaps/printing.md | 8 +++----- tests/testthat/test-complete_separation.R | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/testthat/_snaps/complete_separation.md b/tests/testthat/_snaps/complete_separation.md index 43e14b418..928ebbc8b 100644 --- a/tests/testthat/_snaps/complete_separation.md +++ b/tests/testthat/_snaps/complete_separation.md @@ -44,10 +44,10 @@ Code print(out) Output - Parameter | Log-Odds | SE | 95% CI | z | p - --------------------------------------------------------------- - (Intercept) | -70.25 | 88.29 | [ , -16.06] | -0.80 | 0.426 - qsec | 4.12 | 5.22 | [0.97, ] | 0.79 | 0.430 + Parameter | Log-Odds | SE | 95% CI | z | p + ------------------------------------------------------------------ + (Intercept) | -51.19 | 19.62 | [-105.21, -22.47] | -2.61 | 0.009 + qsec | 2.89 | 1.10 | [ 1.28, 5.93] | 2.63 | 0.009 Message Uncertainty intervals (profile-likelihood) and p-values (two-tailed) diff --git a/tests/testthat/_snaps/printing.md b/tests/testthat/_snaps/printing.md index 1b086c924..e8ba82040 100644 --- a/tests/testthat/_snaps/printing.md +++ b/tests/testthat/_snaps/printing.md @@ -361,9 +361,7 @@ Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation. - This model has a log-transformed response variable, and exponentiated - parameters are reported. - - A one-unit increase in the predictor is associated with multiplying the - outcome by that predictor's coefficient. + The model has a log-transformed response variable, and exponentiated + parameters are reported. A one-unit increase in the predictor is + associated with multiplying the outcome by that predictor's coefficient. diff --git a/tests/testthat/test-complete_separation.R b/tests/testthat/test-complete_separation.R index 28e1a8de1..16e8f25fa 100644 --- a/tests/testthat/test-complete_separation.R +++ b/tests/testthat/test-complete_separation.R @@ -30,7 +30,7 @@ withr::with_options( test_that("print warning about quasi complete separation", { data(mtcars) set.seed(323) - m_sep3 <- suppressWarnings(glm(vs ~ qsec, data = mtcars[sample.int(32, 15, replace = TRUE), ], family = binomial)) # nolint + m_sep3 <- suppressWarnings(glm(vs ~ qsec, data = mtcars[sample.int(32, 27, replace = TRUE), ], family = binomial)) # nolint out <- model_parameters(m_sep3) expect_snapshot(print(out)) }) From dc7ada72439c3fff9e97afb61e668c53e4e698d2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 16:28:59 +0100 Subject: [PATCH 09/13] typo --- R/methods_lme4.R | 2 +- man/model_parameters.merMod.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/methods_lme4.R b/R/methods_lme4.R index 7e282a20d..653bde9a5 100644 --- a/R/methods_lme4.R +++ b/R/methods_lme4.R @@ -45,7 +45,7 @@ #' - If `s_value = TRUE`, the p-value will be replaced by the S-value in the #' output (cf. _Rafi and Greenland 2020_). #' - `pd` adds an additional column with the _probability of direction_ (see -#' [`bayestestR::p_direction()`] for details). urthermore, see 'Examples' for +#' [`bayestestR::p_direction()`] for details). Furthermore, see 'Examples' for #' this function. #' - For developers, whose interest mainly is to get a "tidy" data frame of #' model summaries, it is recommended to set `pretty_names = FALSE` to speed diff --git a/man/model_parameters.merMod.Rd b/man/model_parameters.merMod.Rd index 8ca2889ca..5f34e5714 100644 --- a/man/model_parameters.merMod.Rd +++ b/man/model_parameters.merMod.Rd @@ -307,7 +307,7 @@ arguments will be passed to the print-method, or can directly be used in \item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the output (cf. \emph{Rafi and Greenland 2020}). \item \code{pd} adds an additional column with the \emph{probability of direction} (see -\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). urthermore, see 'Examples' for +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for this function. \item For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set \code{pretty_names = FALSE} to speed From 1b19fb428273629b5d055775e28722bc680e7e57 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 17:06:10 +0100 Subject: [PATCH 10/13] docs --- R/1_model_parameters.R | 18 ++++++++++-------- man/compare_parameters.Rd | 18 ++++++++++-------- man/model_parameters.averaging.Rd | 18 ++++++++++-------- man/model_parameters.cgam.Rd | 18 ++++++++++-------- man/model_parameters.default.Rd | 18 ++++++++++-------- man/model_parameters.glht.Rd | 18 ++++++++++-------- man/model_parameters.merMod.Rd | 18 ++++++++++-------- man/model_parameters.mira.Rd | 18 ++++++++++-------- man/model_parameters.mlm.Rd | 18 ++++++++++-------- man/model_parameters.rma.Rd | 18 ++++++++++-------- man/model_parameters.stanreg.Rd | 18 ++++++++++-------- man/model_parameters.zcpglm.Rd | 18 ++++++++++-------- man/p_function.Rd | 18 ++++++++++-------- man/pool_parameters.Rd | 18 ++++++++++-------- 14 files changed, 140 insertions(+), 112 deletions(-) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 769656f54..458c49600 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -446,14 +446,16 @@ parameters <- model_parameters #' 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 `exponentiate = TRUE` for models -#' with log-transformed response values. **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 `compare_parameters()`, -#' `exponentiate = "nongaussian"` will only exponentiate coefficients from -#' non-Gaussian families. +#' with log-transformed response values. For models with a log-transformed +#' response variable, when `exponentiate = TRUE`, a one-unit increase in the +#' predictor is associated with multiplying the outcome by that predictor's +#' coefficient. **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 `compare_parameters()`, `exponentiate = "nongaussian"` +#' will only exponentiate coefficients from non-Gaussian families. #' @param p_adjust Character vector, if not `NULL`, indicates the method to #' adjust p-values. See [`stats::p.adjust()`] for details. Further #' possible adjustment methods are `"tukey"`, `"scheffe"`, diff --git a/man/compare_parameters.Rd b/man/compare_parameters.Rd index 1b313cd95..073e0ba54 100644 --- a/man/compare_parameters.Rd +++ b/man/compare_parameters.Rd @@ -83,14 +83,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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{ci_method}{Method for computing degrees of freedom for p-values and confidence intervals (CI). See documentation for related model class diff --git a/man/model_parameters.averaging.Rd b/man/model_parameters.averaging.Rd index fa91a77ee..39bbfe0f0 100644 --- a/man/model_parameters.averaging.Rd +++ b/man/model_parameters.averaging.Rd @@ -240,14 +240,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.cgam.Rd b/man/model_parameters.cgam.Rd index e04cbeb3a..72ee6f30c 100644 --- a/man/model_parameters.cgam.Rd +++ b/man/model_parameters.cgam.Rd @@ -100,14 +100,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.default.Rd b/man/model_parameters.default.Rd index e377fe27c..872270db0 100644 --- a/man/model_parameters.default.Rd +++ b/man/model_parameters.default.Rd @@ -110,14 +110,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.glht.Rd b/man/model_parameters.glht.Rd index 55ded27eb..100a8052e 100644 --- a/man/model_parameters.glht.Rd +++ b/man/model_parameters.glht.Rd @@ -24,14 +24,16 @@ or of class \code{PMCMR}, \code{trendPMCMR} or \code{osrt} (\strong{PMCMRplus}). 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.merMod.Rd b/man/model_parameters.merMod.Rd index 5f34e5714..7f7147de7 100644 --- a/man/model_parameters.merMod.Rd +++ b/man/model_parameters.merMod.Rd @@ -249,14 +249,16 @@ are shown.} 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.mira.Rd b/man/model_parameters.mira.Rd index 5b379f152..785151ae2 100644 --- a/man/model_parameters.mira.Rd +++ b/man/model_parameters.mira.Rd @@ -36,14 +36,16 @@ 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.mlm.Rd b/man/model_parameters.mlm.Rd index ccc605b36..11b83a4f8 100644 --- a/man/model_parameters.mlm.Rd +++ b/man/model_parameters.mlm.Rd @@ -114,14 +114,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/model_parameters.rma.Rd b/man/model_parameters.rma.Rd index 39d3d96dd..e388a84b8 100644 --- a/man/model_parameters.rma.Rd +++ b/man/model_parameters.rma.Rd @@ -51,14 +51,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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{include_studies}{Logical, if \code{TRUE} (default), includes parameters for all studies. Else, only parameters for overall-effects are shown.} diff --git a/man/model_parameters.stanreg.Rd b/man/model_parameters.stanreg.Rd index af4303bed..7ea0a94bc 100644 --- a/man/model_parameters.stanreg.Rd +++ b/man/model_parameters.stanreg.Rd @@ -183,14 +183,16 @@ Bayesian models. All arguments in \code{...} are passed to 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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{effects}{Should results for fixed effects, random effects or both be returned? Only applies to mixed models. May be abbreviated.} diff --git a/man/model_parameters.zcpglm.Rd b/man/model_parameters.zcpglm.Rd index 4ed13d492..d7f14b755 100644 --- a/man/model_parameters.zcpglm.Rd +++ b/man/model_parameters.zcpglm.Rd @@ -74,14 +74,16 @@ standardized parameters only works when \code{standardize="refit"}. 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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 diff --git a/man/p_function.Rd b/man/p_function.Rd index fa210dc77..fd82f9f6b 100644 --- a/man/p_function.Rd +++ b/man/p_function.Rd @@ -62,14 +62,16 @@ highlighted values should be named \code{"emph"}, e.g 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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{effects}{Should parameters for fixed effects (\code{"fixed"}), random effects (\code{"random"}), or both (\code{"all"}) be returned? Only applies diff --git a/man/pool_parameters.Rd b/man/pool_parameters.Rd index 6b02889b0..7a848ef03 100644 --- a/man/pool_parameters.Rd +++ b/man/pool_parameters.Rd @@ -22,14 +22,16 @@ pool_parameters( 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.} +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \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{effects}{Should parameters for fixed effects (\code{"fixed"}), random effects (\code{"random"}), or both (\code{"all"}) be returned? Only applies From 441b92e7789f95c104b3ac3c431a870646859bd9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 18:10:06 +0100 Subject: [PATCH 11/13] fix --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 58394ab64..f17e33b98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: parameters Title: Processing of Model Parameters -Version: 0.23.0.4 +Version: 0.23.0.5 Authors@R: c(person(given = "Daniel", family = "Lüdecke", From 7acbe64831473819061a6880c0977bdac088b21d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 18:39:05 +0100 Subject: [PATCH 12/13] remove interpretation --- R/format.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/R/format.R b/R/format.R index 099e9ca85..1939fdd5e 100644 --- a/R/format.R +++ b/R/format.R @@ -879,10 +879,6 @@ format.parameters_sem <- function(x, spurious_coefficients <- NULL } } else if (.is_valid_exponentiate_argument(exponentiate) && isTRUE(.additional_arguments(x, "log_response", FALSE))) { # nolint - msg <- paste( - "The model has a log-transformed response variable, and exponentiated parameters are reported.", - "A one-unit increase in the predictor is associated with multiplying the outcome by that predictor's coefficient." # nolint - ) # don't show warning about complete separation spurious_coefficients <- NULL } From 0c5a1a537d76c2feb3bdf06106300cd1a9e731c1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 27 Oct 2024 18:41:59 +0100 Subject: [PATCH 13/13] update test --- tests/testthat/_snaps/printing.md | 6 +----- tests/testthat/test-printing.R | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/testthat/_snaps/printing.md b/tests/testthat/_snaps/printing.md index e8ba82040..cf03e1e23 100644 --- a/tests/testthat/_snaps/printing.md +++ b/tests/testthat/_snaps/printing.md @@ -347,7 +347,7 @@ Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation. -# message about interpretation of log-resoponse +# no more message about interpretation of log-resoponse Code print(out) @@ -360,8 +360,4 @@ Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation. - - The model has a log-transformed response variable, and exponentiated - parameters are reported. A one-unit increase in the predictor is - associated with multiplying the outcome by that predictor's coefficient. diff --git a/tests/testthat/test-printing.R b/tests/testthat/test-printing.R index 462689fa7..ee0633efa 100644 --- a/tests/testthat/test-printing.R +++ b/tests/testthat/test-printing.R @@ -112,7 +112,7 @@ withr::with_options( withr::with_options( list(parameters_warning_exponentiate = TRUE), { - test_that("message about interpretation of log-resoponse", { + test_that("no more message about interpretation of log-resoponse", { data(mtcars) m <- lm(log(mpg) ~ gear, data = mtcars) out <- model_parameters(m, exponentiate = TRUE)