Learn R Programming

parameters (version 0.10.1)

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,
  ci = 0.95,
  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 t_to_d) for details.

ci

Level of confidence intervals for Cramer's V or phi. Currently only applies to objects from chisq.test().

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)

model <- t.test(mtcars$mpg ~ mtcars$vs)
model_parameters(model)

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

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)
# }

Run the code above in your browser using DataLab