View source: R/methods_htest.R
model_parameters.htest | R Documentation |
Parameters of h-tests (correlations, t-tests, chi-squared, ...).
## S3 method for class 'htest'
model_parameters(
model,
ci = 0.95,
alternative = NULL,
bootstrap = FALSE,
es_type = NULL,
verbose = TRUE,
...
)
## S3 method for class 'coeftest'
model_parameters(
model,
ci = 0.95,
ci_method = "wald",
keep = NULL,
drop = NULL,
verbose = TRUE,
...
)
model |
Object of class |
ci |
Level of confidence intervals for effect size statistic. Currently
only applies to objects from |
alternative |
A character string specifying the alternative hypothesis;
Controls the type of CI returned: |
bootstrap |
Should estimates be bootstrapped? |
es_type |
The effect size of interest. Not that possibly not all effect sizes are applicable to the model object. See 'Details'. For Anova models, can also be a character vector with multiple effect size names. |
verbose |
Toggle warnings and messages. |
... |
Arguments passed to or from other methods. For instance, when
|
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): |
keep |
Character containing a regular expression pattern that
describes the parameters that should be included (for |
drop |
See |
For an object of class htest
, data is extracted via insight::get_data()
, and passed to the relevant function according to:
A t-test depending on type
: "cohens_d"
(default), "hedges_g"
, or one of "p_superiority"
, "u1"
, "u2"
, "u3"
, "overlap"
.
For a Paired t-test: depending on type
: "rm_rm"
, "rm_av"
, "rm_b"
, "rm_d"
, "rm_z"
.
A Chi-squared tests of independence or Fisher's Exact Test, depending on type
: "cramers_v"
(default), "tschuprows_t"
, "phi"
, "cohens_w"
, "pearsons_c"
, "cohens_h"
, "oddsratio"
, "riskratio"
, "arr"
, or "nnt"
.
A Chi-squared tests of goodness-of-fit, depending on type
: "fei"
(default) "cohens_w"
, "pearsons_c"
A One-way ANOVA test, depending on type
: "eta"
(default), "omega"
or "epsilon"
-squared, "f"
, or "f2"
.
A McNemar test returns Cohen's g.
A Wilcoxon test depending on type
: returns "rank_biserial
" correlation (default) or one of "p_superiority"
, "vda"
, "u2"
, "u3"
, "overlap"
.
A Kruskal-Wallis test depending on type
: "epsilon"
(default) or "eta"
.
A Friedman test returns Kendall's W.
(Where applicable, ci
and alternative
are taken from the htest
if not otherwise provided.)
For an object of class BFBayesFactor
, using bayestestR::describe_posterior()
,
A t-test depending on type
: "cohens_d"
(default) or one of "p_superiority"
, "u1"
, "u2"
, "u3"
, "overlap"
.
A correlation test returns r.
A contingency table test, depending on type
: "cramers_v"
(default), "phi"
, "tschuprows_t"
, "cohens_w"
, "pearsons_c"
, "cohens_h"
, "oddsratio"
, or "riskratio"
, "arr"
, or "nnt"
.
A proportion test returns p.
Objects of class anova
, aov
, aovlist
or afex_aov
, depending on type
: "eta"
(default), "omega"
or "epsilon"
-squared, "f"
, or "f2"
.
Other objects are passed to parameters::standardize_parameters()
.
For statistical models it is recommended to directly use the listed functions, for the full range of options they provide.
A data frame of indices related to the model's parameters.
model <- cor.test(mtcars$mpg, mtcars$cyl, method = "pearson")
model_parameters(model)
model <- t.test(iris$Sepal.Width, iris$Sepal.Length)
model_parameters(model, es_type = "hedges_g")
model <- t.test(mtcars$mpg ~ mtcars$vs)
model_parameters(model, es_type = "hedges_g")
model <- t.test(iris$Sepal.Width, mu = 1)
model_parameters(model, es_type = "cohens_d")
data(airquality)
airquality$Month <- factor(airquality$Month, labels = month.abb[5:9])
model <- pairwise.t.test(airquality$Ozone, airquality$Month)
model_parameters(model)
smokers <- c(83, 90, 129, 70)
patients <- c(86, 93, 136, 82)
model <- suppressWarnings(pairwise.prop.test(smokers, patients))
model_parameters(model)
model <- suppressWarnings(chisq.test(table(mtcars$am, mtcars$cyl)))
model_parameters(model, es_type = "cramers_v")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.