interpret: Generic Function for Interpretation

View source: R/interpret.R

interpretR Documentation

Generic Function for Interpretation

Description

Interpret a value based on a set of rules. See rules().

Usage

interpret(x, ...)

## S3 method for class 'numeric'
interpret(x, rules, name = attr(rules, "rule_name"), ...)

## S3 method for class 'effectsize_table'
interpret(x, rules, ...)

Arguments

x

Vector of value break points (edges defining categories), or a data frame of class effectsize_table.

...

Currently not used.

rules

Set of rules(). When x is a data frame, can be a name of an established set of rules.

name

Name of the set of rules (will be printed).

Value

  • For numeric input: A character vector of interpretations.

  • For data frames: the x input with an additional Interpretation column.

See Also

rules()

Examples

rules_grid <- rules(c(0.01, 0.05), c("very significant", "significant", "not significant"))
interpret(0.001, rules_grid)
interpret(0.021, rules_grid)
interpret(0.08, rules_grid)
interpret(c(0.01, 0.005, 0.08), rules_grid)

interpret(c(0.35, 0.15), c("small" = 0.2, "large" = 0.4), name = "Cohen's Rules")
interpret(c(0.35, 0.15), rules(c(0.2, 0.4), c("small", "medium", "large")))

# ----------
d <- cohens_d(mpg ~ am, data = mtcars)
interpret(d, rules = "cohen1988")

d <- glass_delta(mpg ~ am, data = mtcars)
interpret(d, rules = "gignac2016")

interpret(d, rules = rules(1, c("tiny", "yeah okay")))

m <- lm(formula = wt ~ am * cyl, data = mtcars)
eta2 <- eta_squared(m)
interpret(eta2, rules = "field2013")

X <- chisq.test(mtcars$am, mtcars$cyl == 8)
interpret(oddsratio(X), rules = "chen2010")
interpret(cramers_v(X), "lovakov2021")

effectsize documentation built on Oct. 31, 2022, 5:06 p.m.