Equivalence Test for the Pearson Correlation via Two One-Sided Tests (TOST)
Source:R/equivalence_r.R
equivalence_r.RdPerforms a two one-sided tests procedure for equivalence of a Pearson correlation \(\rho\) to zero against user-specified equivalence bounds \([-\rho_L, \rho_U]\) (Counsell & Cribbie, 2015; Goertzen & Cribbie, 2010). Uses the Fisher's \(Z\) transformation throughout, a large-sample approximation whose accuracy under bivariate normality improves quickly with n. Equivalence is declared when the 100(1 - 2\(\alpha\))% Fisher's \(Z\) CI on \(\rho\) lies entirely inside the equivalence region.
Usage
equivalence_r(
r = NULL,
n = NULL,
x = NULL,
y = NULL,
rho_lower = NULL,
rho_upper = NULL,
alpha_level = 0.05
)Arguments
- r, n
Observed sample correlation r and sample size. Alternatively supply
xandyto compute r from raw data.- x, y
Numeric vectors of paired observations. If supplied,
randnare computed from the data and ther/narguments are ignored.- rho_lower, rho_upper
Equivalence bounds on the correlation scale, both positive. The equivalence region is \([-\rho_L, +\rho_U]\). If only
rho_upperis supplied, the bounds are symmetric.- alpha_level
One-sided significance level. Default
0.05.
Value
A data.frame with rows for the observed r,
the two one-sided test statistics on the Fisher's \(Z\) scale,
their p-values, the joint TOST p-value, the
100(1 - 2\(\alpha\))% CI on \(\rho\), the equivalence bounds,
a binary equivalence flag, and the sample size (n).
Details
Fisher's \(Z\) transformation. $$Z = \tfrac{1}{2} \log\left(\frac{1 + r}{1 - r}\right), \quad \mathrm{Var}(Z) = \frac{1}{n - 3}.$$ The TOST is run on the Fisher's \(Z\) scale:
Lower test: \((Z - Z_{-\rho_L}) \sqrt{n - 3}\) compared against the upper \(\alpha\) of \(N(0, 1)\).
Upper test: \((Z - Z_{\rho_U}) \sqrt{n - 3}\) compared against the lower \(\alpha\) of \(N(0, 1)\).
The CI bounds are back-transformed from the \(Z\) scale via \(r = \tanh(Z)\) so they remain in \([-1, 1]\).
Choosing \(\rho_L\) and \(\rho_U\). Common choices in psychology are \(0.1\), or domain-specific meaningfulness thresholds (e.g., \(0.2\) for cognitive task correlations). The bounds must be set before data collection.
References
Counsell, A., & Cribbie, R. A. (2015). Equivalence tests for comparing correlation and regression coefficients. British Journal of Mathematical and Statistical Psychology, 68(2), 292–309. doi:10.1111/bmsp.12045
Goertzen, J. R., & Cribbie, R. A. (2010). Detecting a lack of association: An equivalence testing approach. British Journal of Mathematical and Statistical Psychology, 63(3), 527–537. doi:10.1348/000711009X475853
Lakens, D. (2017). Equivalence tests: A practical primer for t tests, correlations, and meta-analyses. Social Psychological and Personality Science, 8(4), 355–362. doi:10.1177/1948550617697177
See also
Other hypothesis tests:
adjusted_means(),
ancova(),
anova_within(),
ci_dunnett(),
ci_scheffe(),
ci_tukey_kramer(),
compare_cov_structures(),
contrast_test(),
correlations_test(),
equivalence_smd(),
factorial_anova(),
manova_split_plot(),
mauchly_test(),
mixed_anova(),
obrien_test(),
pairwise_within(),
randomization_test(),
randomization_test_paired(),
regions_of_significance(),
simple_effects_AB(),
summary_t_test(),
welch_t()
Other equivalence testing:
equivalence_c(),
equivalence_smd(),
plot_equivalence(),
power_density_equivalence_md(),
power_equivalence_c(),
power_equivalence_md(),
power_equivalence_md_plot(),
ss_power_equivalence_c()
Author
Ken Kelley kkelley@nd.edu
Examples
# 1. Equivalence test that |rho| < 0.10 with n = 200 and r = 0.05:
equivalence_r(r = 0.05, n = 200, rho_upper = 0.10)
#> term value
#> r 0.05
#> z_lower_test 2.11
#> z_upper_test -0.706
#> p_lower 0.0174
#> p_upper 0.2401
#> p_tost 0.2401
#> lower_limit -0.067
#> upper_limit 0.166
#> rho_lower -0.1
#> rho_upper 0.1
#> equivalent 0
#> n 200
#>
#> Confidence level: 90%
# 2. From raw data:
set.seed(113)
x <- rnorm(150); y <- 0.04 * x + rnorm(150)
equivalence_r(x = x, y = y, rho_upper = 0.15)
#> term value
#> r -0.0329
#> z_lower_test 1.43
#> z_upper_test -2.23
#> p_lower 0.0759
#> p_upper 0.0128
#> p_tost 0.0759
#> lower_limit -0.167
#> upper_limit 0.102
#> rho_lower -0.15
#> rho_upper 0.15
#> equivalent 0
#> n 150
#>
#> Confidence level: 90%