Learn R Programming

parameters (version 0.17.0)

model_parameters.htest: Parameters from hypothesis tests

Description

Parameters of h-tests (correlations, t-tests, chi-squared, ...).

Usage

# S3 method for htest
model_parameters(
  model,
  cramers_v = NULL,
  phi = NULL,
  standardized_d = NULL,
  hedges_g = NULL,
  omega_squared = NULL,
  eta_squared = NULL,
  epsilon_squared = NULL,
  cohens_g = NULL,
  rank_biserial = NULL,
  rank_epsilon_squared = NULL,
  kendalls_w = NULL,
  ci = 0.95,
  alternative = NULL,
  bootstrap = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for pairwise.htest model_parameters(model, verbose = TRUE, ...)

Arguments

model

Object of class htest or pairwise.htest.

cramers_v, phi

Compute Cramer's V or phi as index of effect size. Can be "raw" or "adjusted" (effect size will be bias-corrected). Only applies to objects from chisq.test().

standardized_d

If TRUE, compute standardized d as index of effect size. Only applies to objects from t.test(). Calculation of d is based on the t-value (see effectsize::t_to_d()) for details.

hedges_g

If TRUE, compute Hedge's g as index of effect size. Only applies to objects from t.test().

omega_squared, eta_squared, epsilon_squared

Logical, if TRUE, returns the non-partial effect size Omega, Eta or Epsilon squared. Only applies to objects from oneway.test().

cohens_g

If TRUE, compute Cohen's g as index of effect size. Only applies to objects from mcnemar.test().

rank_biserial

If TRUE, compute the rank-biserial correlation as effect size measure. Only applies to objects from wilcox.test().

rank_epsilon_squared

If TRUE, compute the rank epsilon squared as effect size measure. Only applies to objects from kruskal.test().

kendalls_w

If TRUE, compute the Kendall's coefficient of concordance as effect size measure. Only applies to objects from friedman.test().

ci

Level of confidence intervals for effect size statistic. Currently only applies to objects from chisq.test() or oneway.test().

alternative

A character string specifying the alternative hypothesis; Controls the type of CI returned: "two.sided" (default, two-sided CI), "greater" or "less" (one-sided CI). Partial matching is allowed (e.g., "g", "l", "two"...). See section One-Sided CIs in the effectsize_CIs vignette.

bootstrap

Should estimates be bootstrapped?

verbose

Toggle warnings and messages.

...

Arguments passed to or from other methods.

Value

A data frame of indices related to the model's parameters.

Examples

Run this code
# NOT RUN {
model <- cor.test(mtcars$mpg, mtcars$cyl, method = "pearson")
model_parameters(model)

model <- t.test(iris$Sepal.Width, iris$Sepal.Length)
model_parameters(model, hedges_g = TRUE)

model <- t.test(mtcars$mpg ~ mtcars$vs)
model_parameters(model, hedges_g = TRUE)

model <- t.test(iris$Sepal.Width, mu = 1)
model_parameters(model, standardized_d = TRUE)

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 <- pairwise.prop.test(smokers, patients)
model_parameters(model)

model <- stats::chisq.test(table(mtcars$am, mtcars$cyl))
model_parameters(model, cramers_v = "adjusted")

# }

Run the code above in your browser using DataLab