equivalence_test.effectsize_table: Test for Practical Equivalence

Description Usage Arguments Details Value References See Also Examples

View source: R/equivalence_test.R

Description

Perform a Test for Practical Equivalence for indices of effect size.

Usage

1
2
3
4
5
6
7
## S3 method for class 'effectsize_table'
equivalence_test(
  x,
  range = "default",
  rule = c("classic", "cet", "bayes"),
  ...
)

Arguments

x

An effect size table, such as returned by cohens_d(), eta_squared(), F_to_r(), etc.

range

The range of practical equivalence of an effect. For one-sides CIs, a single value can be proved for the lower / upper bound to test against (but see more details below). For two-sided CIs, a single value is duplicated to c(-range, range). If "default", will be set to [-.1, .1].

rule

How should acceptance and rejection be decided? See details.

...

Arguments passed to or from other methods.

Details

The CIs used in the equivalence test are the ones in the provided effect size table. For results equivalent (ha!) to those that can be obtained using the TOST approach (e.g., Lakens, 2017), appropriate CIs should be extracted using the function used to make the effect size table (cohens_d, eta_squared, F_to_r, etc), with alternative = "two.sided". See examples.

The Different Rules

Value

A data frame with the results of the equivalence test.

References

See Also

For more details, see bayestestR::equivalence_test().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
model <- aov(mpg ~ hp + am * factor(cyl), data = mtcars)
es <- eta_squared(model, ci = 0.9, alternative = "two.sided")
equivalence_test(es, range = 0.30) # TOST

RCT <- matrix(c(71, 101,
                50, 100), nrow = 2)
OR <- oddsratio(RCT, alternative = "greater")
equivalence_test(OR, range = 1)

ds <- t_to_d(
  t = c(0.45, -0.65, 7, -2.2, 2.25),
  df_error = c(675, 525, 2000, 900, 1875),
  ci = 0.9, alternative = "two.sided" # TOST
)
# Can also plot
if (require(see)) plot(equivalence_test(ds, range = 0.2))
if (require(see)) plot(equivalence_test(ds, range = 0.2, rule = "cet"))
if (require(see)) plot(equivalence_test(ds, range = 0.2, rule = "bayes"))

effectsize documentation built on Oct. 4, 2021, 9:06 a.m.