From 93528fdad37e318888f3f809a35420fd528771d7 Mon Sep 17 00:00:00 2001 From: jimrothstein Date: Mon, 17 Oct 2022 02:15:06 -0700 Subject: [PATCH 1/4] TEST ... added @export to method for model_parameters.zoo --- NAMESPACE | 1 + R/1_model_parameters.R | 5 +++++ man/dominance_analysis.Rd | 8 -------- man/model_parameters.aov.Rd | 28 ---------------------------- man/model_parameters.htest.Rd | 28 ---------------------------- man/model_parameters.zoo.Rd | 27 +++++++++++++++++++++++++++ man/standardize_parameters.Rd | 2 -- 7 files changed, 33 insertions(+), 66 deletions(-) create mode 100644 man/model_parameters.zoo.Rd diff --git a/NAMESPACE b/NAMESPACE index 01ad4db5b..da178b27f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -365,6 +365,7 @@ S3method(model_parameters,yuen) S3method(model_parameters,zcpglm) S3method(model_parameters,zerocount) S3method(model_parameters,zeroinfl) +S3method(model_parameters,zoo) S3method(p_value,BBmm) S3method(p_value,BBreg) S3method(p_value,BFBayesFactor) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 321581ca5..a1383d3fd 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -692,3 +692,8 @@ model_parameters.glm <- function(model, attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model)) out } +NULL +#' @title model_parameters.zoo +#' @description jr added Oct 17 +#' @export +model_parameters.zoo <- model_parameters.default diff --git a/man/dominance_analysis.Rd b/man/dominance_analysis.Rd index 28c95697c..c752f603a 100644 --- a/man/dominance_analysis.Rd +++ b/man/dominance_analysis.Rd @@ -34,14 +34,6 @@ analysis and the R2 value associated with them is subtracted from the overall value. Predictors in \code{all} must be present in the model submitted to the \code{model} argument and cannot be in the \code{sets} argument.} -\item{conditional}{Logical. If \code{FALSE} then conditional dominance matrix is not computed. - -If conditional dominance is not desired as an importance criterion, avoiding computing the conditional dominance matrix can save computation time.} - -\item{complete}{Logical. If \code{FALSE} then complete dominance matrix is not computed. - -If complete dominance is not desired as an importance criterion, avoiding computing complete dominance designations can save computation time.} - \item{quote_args}{A character vector of arguments in the model submitted to \code{model} to \code{quote()} prior to submitting to the dominance analysis. This is necessary for data masked arguments (e.g., \code{weights}) to prevent them diff --git a/man/model_parameters.aov.Rd b/man/model_parameters.aov.Rd index fd67c97fc..5a3b59a73 100644 --- a/man/model_parameters.aov.Rd +++ b/man/model_parameters.aov.Rd @@ -220,34 +220,6 @@ A data frame of indices related to the model's parameters. \description{ Parameters from ANOVAs } -\details{ -\itemize{ -\item For an object of class \code{htest}, data is extracted via \code{\link[insight:get_data]{insight::get_data()}}, and passed to the relevant function according to: -\itemize{ -\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default), \code{"hedges_g"}, or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. -\item A \strong{Chi-squared tests of independence} or \strong{Fisher's Exact Test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"tschuprows_t"}, \code{"phi"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. -\item A \strong{Chi-squared tests of goodness-of-fit}, depending on \code{type}: \code{"fei"} (default) \code{"cohens_w"}, \code{"pearsons_c"} -\item A \strong{One-way ANOVA test}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. -\item A \strong{McNemar test} returns \emph{Cohen's g}. -\item A \strong{Wilcoxon test} depending on \code{type}: returns "\code{rank_biserial}" correlation (default) or one of \code{"p_superiority"}, \code{"vda"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. -\item A \strong{Kruskal-Wallis test} depending on \code{type}: \code{"epsilon"} (default) or \code{"eta"}. -\item A \strong{Friedman test} returns \emph{Kendall's W}. -(Where applicable, \code{ci} and \code{alternative} are taken from the \code{htest} if not otherwise provided.) -} -\item For an object of class \code{BFBayesFactor}, using \code{\link[bayestestR:describe_posterior]{bayestestR::describe_posterior()}}, -\itemize{ -\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default) or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. -\item A \strong{correlation test} returns \emph{r}. -\item A \strong{contingency table test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"phi"}, \code{"tschuprows_t"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. -\item A \strong{proportion test} returns \emph{p}. -} -\item Objects of class \code{anova}, \code{aov}, \code{aovlist} or \code{afex_aov}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. -\item Other objects are passed to \code{\link[parameters:standardize_parameters]{parameters::standardize_parameters()}}. -} - -\strong{For statistical models it is recommended to directly use the listed -functions, for the full range of options they provide.} -} \note{ For ANOVA-tables from mixed models (i.e. \code{anova(lmer())}), only partial or adjusted effect sizes can be computed. Note that type 3 ANOVAs diff --git a/man/model_parameters.htest.Rd b/man/model_parameters.htest.Rd index c43490365..167868bd4 100644 --- a/man/model_parameters.htest.Rd +++ b/man/model_parameters.htest.Rd @@ -73,34 +73,6 @@ A data frame of indices related to the model's parameters. \description{ Parameters of h-tests (correlations, t-tests, chi-squared, ...). } -\details{ -\itemize{ -\item For an object of class \code{htest}, data is extracted via \code{\link[insight:get_data]{insight::get_data()}}, and passed to the relevant function according to: -\itemize{ -\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default), \code{"hedges_g"}, or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. -\item A \strong{Chi-squared tests of independence} or \strong{Fisher's Exact Test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"tschuprows_t"}, \code{"phi"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. -\item A \strong{Chi-squared tests of goodness-of-fit}, depending on \code{type}: \code{"fei"} (default) \code{"cohens_w"}, \code{"pearsons_c"} -\item A \strong{One-way ANOVA test}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. -\item A \strong{McNemar test} returns \emph{Cohen's g}. -\item A \strong{Wilcoxon test} depending on \code{type}: returns "\code{rank_biserial}" correlation (default) or one of \code{"p_superiority"}, \code{"vda"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. -\item A \strong{Kruskal-Wallis test} depending on \code{type}: \code{"epsilon"} (default) or \code{"eta"}. -\item A \strong{Friedman test} returns \emph{Kendall's W}. -(Where applicable, \code{ci} and \code{alternative} are taken from the \code{htest} if not otherwise provided.) -} -\item For an object of class \code{BFBayesFactor}, using \code{\link[bayestestR:describe_posterior]{bayestestR::describe_posterior()}}, -\itemize{ -\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default) or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. -\item A \strong{correlation test} returns \emph{r}. -\item A \strong{contingency table test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"phi"}, \code{"tschuprows_t"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. -\item A \strong{proportion test} returns \emph{p}. -} -\item Objects of class \code{anova}, \code{aov}, \code{aovlist} or \code{afex_aov}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. -\item Other objects are passed to \code{\link[parameters:standardize_parameters]{parameters::standardize_parameters()}}. -} - -\strong{For statistical models it is recommended to directly use the listed -functions, for the full range of options they provide.} -} \examples{ model <- cor.test(mtcars$mpg, mtcars$cyl, method = "pearson") diff --git a/man/model_parameters.zoo.Rd b/man/model_parameters.zoo.Rd new file mode 100644 index 000000000..a3f630aef --- /dev/null +++ b/man/model_parameters.zoo.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/1_model_parameters.R +\name{model_parameters.zoo} +\alias{model_parameters.zoo} +\title{model_parameters.zoo} +\usage{ +\method{model_parameters}{zoo}( + 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, + ... +) +} +\description{ +jr added Oct 17 +} diff --git a/man/standardize_parameters.Rd b/man/standardize_parameters.Rd index b8a4cdab4..e97876659 100644 --- a/man/standardize_parameters.Rd +++ b/man/standardize_parameters.Rd @@ -36,8 +36,6 @@ standardize_posteriors( \code{"refit"} (default), \code{"posthoc"}, \code{"smart"}, \code{"basic"} or \code{"pseudo"}. See 'Details'.} -\item{ci}{Confidence Interval (CI) level} - \item{robust}{Logical, if \code{TRUE}, centering is done by subtracting the median from the variables and dividing it by the median absolute deviation (MAD). If \code{FALSE}, variables are standardized by subtracting the From 33c767065f931f7e9a232424745bb34c8fd42c5a Mon Sep 17 00:00:00 2001 From: jimrothstein Date: Tue, 18 Oct 2022 00:59:20 -0700 Subject: [PATCH 2/4] add @export for model_parameters method zoo -- TEST --- R/1_model_parameters.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 321581ca5..c2811ca2e 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -692,3 +692,6 @@ model_parameters.glm <- function(model, attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model)) out } + +#' @export +model_parameters.zoo <- model_parameters.default From 6a00782988a65ffe920beadf18e71de967ce432a Mon Sep 17 00:00:00 2001 From: jimrothstein Date: Tue, 18 Oct 2022 02:12:35 -0700 Subject: [PATCH 3/4] TEST ... all easystats packages installed ... document() --- R/1_model_parameters.R | 1 - man/dominance_analysis.Rd | 8 ++++++++ man/model_parameters.aov.Rd | 28 ++++++++++++++++++++++++++++ man/model_parameters.htest.Rd | 28 ++++++++++++++++++++++++++++ man/model_parameters.zoo.Rd | 27 --------------------------- man/standardize_parameters.Rd | 2 ++ 6 files changed, 66 insertions(+), 28 deletions(-) delete mode 100644 man/model_parameters.zoo.Rd diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index c2811ca2e..bd43ae66f 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -692,6 +692,5 @@ model_parameters.glm <- function(model, attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model)) out } - #' @export model_parameters.zoo <- model_parameters.default diff --git a/man/dominance_analysis.Rd b/man/dominance_analysis.Rd index c752f603a..28c95697c 100644 --- a/man/dominance_analysis.Rd +++ b/man/dominance_analysis.Rd @@ -34,6 +34,14 @@ analysis and the R2 value associated with them is subtracted from the overall value. Predictors in \code{all} must be present in the model submitted to the \code{model} argument and cannot be in the \code{sets} argument.} +\item{conditional}{Logical. If \code{FALSE} then conditional dominance matrix is not computed. + +If conditional dominance is not desired as an importance criterion, avoiding computing the conditional dominance matrix can save computation time.} + +\item{complete}{Logical. If \code{FALSE} then complete dominance matrix is not computed. + +If complete dominance is not desired as an importance criterion, avoiding computing complete dominance designations can save computation time.} + \item{quote_args}{A character vector of arguments in the model submitted to \code{model} to \code{quote()} prior to submitting to the dominance analysis. This is necessary for data masked arguments (e.g., \code{weights}) to prevent them diff --git a/man/model_parameters.aov.Rd b/man/model_parameters.aov.Rd index 5a3b59a73..fd67c97fc 100644 --- a/man/model_parameters.aov.Rd +++ b/man/model_parameters.aov.Rd @@ -220,6 +220,34 @@ A data frame of indices related to the model's parameters. \description{ Parameters from ANOVAs } +\details{ +\itemize{ +\item For an object of class \code{htest}, data is extracted via \code{\link[insight:get_data]{insight::get_data()}}, and passed to the relevant function according to: +\itemize{ +\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default), \code{"hedges_g"}, or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. +\item A \strong{Chi-squared tests of independence} or \strong{Fisher's Exact Test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"tschuprows_t"}, \code{"phi"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. +\item A \strong{Chi-squared tests of goodness-of-fit}, depending on \code{type}: \code{"fei"} (default) \code{"cohens_w"}, \code{"pearsons_c"} +\item A \strong{One-way ANOVA test}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. +\item A \strong{McNemar test} returns \emph{Cohen's g}. +\item A \strong{Wilcoxon test} depending on \code{type}: returns "\code{rank_biserial}" correlation (default) or one of \code{"p_superiority"}, \code{"vda"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. +\item A \strong{Kruskal-Wallis test} depending on \code{type}: \code{"epsilon"} (default) or \code{"eta"}. +\item A \strong{Friedman test} returns \emph{Kendall's W}. +(Where applicable, \code{ci} and \code{alternative} are taken from the \code{htest} if not otherwise provided.) +} +\item For an object of class \code{BFBayesFactor}, using \code{\link[bayestestR:describe_posterior]{bayestestR::describe_posterior()}}, +\itemize{ +\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default) or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. +\item A \strong{correlation test} returns \emph{r}. +\item A \strong{contingency table test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"phi"}, \code{"tschuprows_t"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. +\item A \strong{proportion test} returns \emph{p}. +} +\item Objects of class \code{anova}, \code{aov}, \code{aovlist} or \code{afex_aov}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. +\item Other objects are passed to \code{\link[parameters:standardize_parameters]{parameters::standardize_parameters()}}. +} + +\strong{For statistical models it is recommended to directly use the listed +functions, for the full range of options they provide.} +} \note{ For ANOVA-tables from mixed models (i.e. \code{anova(lmer())}), only partial or adjusted effect sizes can be computed. Note that type 3 ANOVAs diff --git a/man/model_parameters.htest.Rd b/man/model_parameters.htest.Rd index 167868bd4..c43490365 100644 --- a/man/model_parameters.htest.Rd +++ b/man/model_parameters.htest.Rd @@ -73,6 +73,34 @@ A data frame of indices related to the model's parameters. \description{ Parameters of h-tests (correlations, t-tests, chi-squared, ...). } +\details{ +\itemize{ +\item For an object of class \code{htest}, data is extracted via \code{\link[insight:get_data]{insight::get_data()}}, and passed to the relevant function according to: +\itemize{ +\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default), \code{"hedges_g"}, or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. +\item A \strong{Chi-squared tests of independence} or \strong{Fisher's Exact Test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"tschuprows_t"}, \code{"phi"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. +\item A \strong{Chi-squared tests of goodness-of-fit}, depending on \code{type}: \code{"fei"} (default) \code{"cohens_w"}, \code{"pearsons_c"} +\item A \strong{One-way ANOVA test}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. +\item A \strong{McNemar test} returns \emph{Cohen's g}. +\item A \strong{Wilcoxon test} depending on \code{type}: returns "\code{rank_biserial}" correlation (default) or one of \code{"p_superiority"}, \code{"vda"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. +\item A \strong{Kruskal-Wallis test} depending on \code{type}: \code{"epsilon"} (default) or \code{"eta"}. +\item A \strong{Friedman test} returns \emph{Kendall's W}. +(Where applicable, \code{ci} and \code{alternative} are taken from the \code{htest} if not otherwise provided.) +} +\item For an object of class \code{BFBayesFactor}, using \code{\link[bayestestR:describe_posterior]{bayestestR::describe_posterior()}}, +\itemize{ +\item A \strong{t-test} depending on \code{type}: \code{"cohens_d"} (default) or one of \code{"p_superiority"}, \code{"u1"}, \code{"u2"}, \code{"u3"}, \code{"overlap"}. +\item A \strong{correlation test} returns \emph{r}. +\item A \strong{contingency table test}, depending on \code{type}: \code{"cramers_v"} (default), \code{"phi"}, \code{"tschuprows_t"}, \code{"cohens_w"}, \code{"pearsons_c"}, \code{"cohens_h"}, \code{"oddsratio"}, or \code{"riskratio"}. +\item A \strong{proportion test} returns \emph{p}. +} +\item Objects of class \code{anova}, \code{aov}, \code{aovlist} or \code{afex_aov}, depending on \code{type}: \code{"eta"} (default), \code{"omega"} or \code{"epsilon"} -squared, \code{"f"}, or \code{"f2"}. +\item Other objects are passed to \code{\link[parameters:standardize_parameters]{parameters::standardize_parameters()}}. +} + +\strong{For statistical models it is recommended to directly use the listed +functions, for the full range of options they provide.} +} \examples{ model <- cor.test(mtcars$mpg, mtcars$cyl, method = "pearson") diff --git a/man/model_parameters.zoo.Rd b/man/model_parameters.zoo.Rd deleted file mode 100644 index a3f630aef..000000000 --- a/man/model_parameters.zoo.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/1_model_parameters.R -\name{model_parameters.zoo} -\alias{model_parameters.zoo} -\title{model_parameters.zoo} -\usage{ -\method{model_parameters}{zoo}( - 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, - ... -) -} -\description{ -jr added Oct 17 -} diff --git a/man/standardize_parameters.Rd b/man/standardize_parameters.Rd index e97876659..b8a4cdab4 100644 --- a/man/standardize_parameters.Rd +++ b/man/standardize_parameters.Rd @@ -36,6 +36,8 @@ standardize_posteriors( \code{"refit"} (default), \code{"posthoc"}, \code{"smart"}, \code{"basic"} or \code{"pseudo"}. See 'Details'.} +\item{ci}{Confidence Interval (CI) level} + \item{robust}{Logical, if \code{TRUE}, centering is done by subtracting the median from the variables and dividing it by the median absolute deviation (MAD). If \code{FALSE}, variables are standardized by subtracting the From ef3a4b04ffc98504bd9ae0c5faed223a58aaa0d0 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 18 Oct 2022 11:17:28 +0200 Subject: [PATCH 4/4] Update R/1_model_parameters.R --- R/1_model_parameters.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index bd43ae66f..c2811ca2e 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -692,5 +692,6 @@ model_parameters.glm <- function(model, attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model)) out } + #' @export model_parameters.zoo <- model_parameters.default