diff --git a/R/estimate_contrasts.R b/R/estimate_contrasts.R index 434b0afa..18b88743 100644 --- a/R/estimate_contrasts.R +++ b/R/estimate_contrasts.R @@ -104,11 +104,11 @@ estimate_contrasts.default <- function(model, by = NULL, predict = NULL, ci = 0.95, - p_adjust = "none", comparison = "pairwise", estimate = "average", - backend = getOption("modelbased_backend", "marginaleffects"), + p_adjust = "none", transform = NULL, + backend = getOption("modelbased_backend", "marginaleffects"), verbose = TRUE, ...) { if (backend == "emmeans") { diff --git a/R/estimate_means.R b/R/estimate_means.R index a5821f86..050691a4 100644 --- a/R/estimate_means.R +++ b/R/estimate_means.R @@ -181,8 +181,8 @@ estimate_means <- function(model, predict = NULL, ci = 0.95, estimate = "average", - backend = getOption("modelbased_backend", "marginaleffects"), transform = NULL, + backend = getOption("modelbased_backend", "marginaleffects"), verbose = TRUE, ...) { # validate input diff --git a/R/get_marginalcontrasts.R b/R/get_marginalcontrasts.R index a790b63d..548252cc 100644 --- a/R/get_marginalcontrasts.R +++ b/R/get_marginalcontrasts.R @@ -4,9 +4,9 @@ get_marginalcontrasts <- function(model, contrast = NULL, by = NULL, predict = NULL, + ci = 0.95, comparison = "pairwise", estimate = "average", - ci = 0.95, p_adjust = "none", transform = NULL, verbose = TRUE, diff --git a/man/estimate_contrasts.Rd b/man/estimate_contrasts.Rd index b54a3edc..0a7016db 100644 --- a/man/estimate_contrasts.Rd +++ b/man/estimate_contrasts.Rd @@ -13,11 +13,11 @@ estimate_contrasts(model, ...) by = NULL, predict = NULL, ci = 0.95, - p_adjust = "none", comparison = "pairwise", estimate = "average", - backend = getOption("modelbased_backend", "marginaleffects"), + p_adjust = "none", transform = NULL, + backend = getOption("modelbased_backend", "marginaleffects"), verbose = TRUE, ... ) @@ -84,12 +84,6 @@ for instance \code{"sigma"}, \code{"kappa"}, etc.} \item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).} -\item{p_adjust}{The p-values adjustment method for frequentist multiple -comparisons. Can be one of \code{"none"} (default), \code{"hochberg"}, \code{"hommel"}, -\code{"bonferroni"}, \code{"BH"}, \code{"BY"}, \code{"fdr"}, \code{"tukey"} or \code{"holm"}. See the -p-value adjustment section in the \code{emmeans::test} documentation or -\code{?stats::p.adjust}.} - \item{comparison}{Specify the type of contrasts or tests that should be carried out. \itemize{ @@ -159,6 +153,20 @@ and the other prediction functions. \code{estimate_means(..., estimate = "population")} }} +\item{p_adjust}{The p-values adjustment method for frequentist multiple +comparisons. Can be one of \code{"none"} (default), \code{"hochberg"}, \code{"hommel"}, +\code{"bonferroni"}, \code{"BH"}, \code{"BY"}, \code{"fdr"}, \code{"tukey"} or \code{"holm"}. See the +p-value adjustment section in the \code{emmeans::test} documentation or +\code{?stats::p.adjust}.} + +\item{transform}{A function applied to predictions and confidence intervals +to (back-) transform results, which can be useful in case the regression +model has a transformed response variable (e.g., \code{lm(log(y) ~ x)}). For +Bayesian models, this function is applied to individual draws from the +posterior distribution, before computing summaries. Can also be \code{TRUE}, in +which case \code{insight::get_transformation()} is called to determine the +appropriate transformation-function.} + \item{backend}{Whether to use \code{"emmeans"} or \code{"marginaleffects"} as a backend. Results are usually very similar. The major difference will be found for mixed models, where \code{backend = "marginaleffects"} will also average across random @@ -170,14 +178,6 @@ You can set a default backend via \code{options()}, e.g. use \code{options(modelbased_backend = "marginaleffects")} to set \strong{marginaleffects} as default backend.} -\item{transform}{A function applied to predictions and confidence intervals -to (back-) transform results, which can be useful in case the regression -model has a transformed response variable (e.g., \code{lm(log(y) ~ x)}). For -Bayesian models, this function is applied to individual draws from the -posterior distribution, before computing summaries. Can also be \code{TRUE}, in -which case \code{insight::get_transformation()} is called to determine the -appropriate transformation-function.} - \item{verbose}{Use \code{FALSE} to silence messages and warnings.} } \value{ diff --git a/man/estimate_means.Rd b/man/estimate_means.Rd index 0ee1743b..87cbfff5 100644 --- a/man/estimate_means.Rd +++ b/man/estimate_means.Rd @@ -10,8 +10,8 @@ estimate_means( predict = NULL, ci = 0.95, estimate = "average", - backend = getOption("modelbased_backend", "marginaleffects"), transform = NULL, + backend = getOption("modelbased_backend", "marginaleffects"), verbose = TRUE, ... ) @@ -98,6 +98,14 @@ and the other prediction functions. \code{estimate_means(..., estimate = "population")} }} +\item{transform}{A function applied to predictions and confidence intervals +to (back-) transform results, which can be useful in case the regression +model has a transformed response variable (e.g., \code{lm(log(y) ~ x)}). For +Bayesian models, this function is applied to individual draws from the +posterior distribution, before computing summaries. Can also be \code{TRUE}, in +which case \code{insight::get_transformation()} is called to determine the +appropriate transformation-function.} + \item{backend}{Whether to use \code{"emmeans"} or \code{"marginaleffects"} as a backend. Results are usually very similar. The major difference will be found for mixed models, where \code{backend = "marginaleffects"} will also average across random @@ -109,14 +117,6 @@ You can set a default backend via \code{options()}, e.g. use \code{options(modelbased_backend = "marginaleffects")} to set \strong{marginaleffects} as default backend.} -\item{transform}{A function applied to predictions and confidence intervals -to (back-) transform results, which can be useful in case the regression -model has a transformed response variable (e.g., \code{lm(log(y) ~ x)}). For -Bayesian models, this function is applied to individual draws from the -posterior distribution, before computing summaries. Can also be \code{TRUE}, in -which case \code{insight::get_transformation()} is called to determine the -appropriate transformation-function.} - \item{verbose}{Use \code{FALSE} to silence messages and warnings.} \item{...}{Other arguments passed, for instance, to \code{\link[insight:get_datagrid]{insight::get_datagrid()}}, diff --git a/man/get_emmeans.Rd b/man/get_emmeans.Rd index 428bafb6..93b906bc 100644 --- a/man/get_emmeans.Rd +++ b/man/get_emmeans.Rd @@ -38,9 +38,9 @@ get_marginalcontrasts( contrast = NULL, by = NULL, predict = NULL, + ci = 0.95, comparison = "pairwise", estimate = "average", - ci = 0.95, p_adjust = "none", transform = NULL, verbose = TRUE, @@ -162,6 +162,8 @@ Additional arguments can be passed to these functions. \item{trend}{A character indicating the name of the variable for which to compute the slopes.} +\item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).} + \item{estimate}{Character string, indicating the type of target population predictions refer to. This dictates how the predictions are "averaged" over the non-focal predictors, i.e. those variables that are not specified in @@ -202,8 +204,6 @@ and the other prediction functions. \code{estimate_means(..., estimate = "population")} }} -\item{ci}{Confidence Interval (CI) level. Default to \code{0.95} (\verb{95\%}).} - \item{p_adjust}{The p-values adjustment method for frequentist multiple comparisons. Can be one of \code{"none"} (default), \code{"hochberg"}, \code{"hommel"}, \code{"bonferroni"}, \code{"BH"}, \code{"BY"}, \code{"fdr"}, \code{"tukey"} or \code{"holm"}. See the