compare_cor | R Documentation |
A function to compare correlations between independent studies. This function is intended to be used to compare the compatibility of original studies with replication studies (lower p-values indicating lower compatibility).
compare_cor(
r1,
df1,
r2,
df2,
method = c("fisher", "kraatz"),
alternative = c("two.sided", "less", "greater", "equivalence", "minimal.effect"),
null = 0
)
r1 |
Correlation from study 1. |
df1 |
Degrees of freedom from study 1 (if a simple correlation the df is N-2). |
r2 |
Correlation from study 2. |
df2 |
Degrees of freedom from study 2 (if a simple correlation the df is N-2). |
method |
Method for determining differences:
|
alternative |
A character string specifying the alternative hypothesis:
You can specify just the initial letter. |
null |
A number or vector indicating the null hypothesis value(s):
|
This function tests for differences between correlation coefficients from independent studies. It is particularly useful for:
Comparing an original study with its replication
Meta-analytic comparisons between studies
Testing if correlations from different samples are equivalent
The function offers two methods for comparing correlations:
Fisher's z transformation (default): Transforms correlations to stabilize variance
Kraatz method: Uses a direct approach that may be more appropriate for larger correlations
The function supports both standard hypothesis testing and equivalence/minimal effect testing:
For standard tests (two.sided, less, greater), the function tests whether the difference between correlations differs from the null value (typically 0).
For equivalence testing ("equivalence"), it determines whether the difference falls within the specified bounds, which can be set asymmetrically.
For minimal effect testing ("minimal.effect"), it determines whether the difference falls outside the specified bounds.
When performing equivalence or minimal effect testing:
If a single value is provided for null
, symmetric bounds ±value will be used
If two values are provided for null
, they will be used as the lower and upper bounds
A list with class "htest" containing the following components:
statistic: z-score with name "z"
p.value: numeric scalar containing the p-value for the test under the null hypothesis
estimate: difference in correlation coefficients between studies
null.value: the specified hypothesized value(s) for the null hypothesis
alternative: character string indicating the alternative hypothesis
method: description of the method used for comparison
data.name: "Summary Statistics" to denote summary statistics were utilized
cor: list containing the correlation coefficients used in the comparison
call: the matched call
Counsell, A., & Cribbie, R. A. (2015). Equivalence tests for comparing correlation and regression coefficients. The British journal of mathematical and statistical psychology, 68(2), 292-309. https://doi.org/10.1111/bmsp.12045
Anderson, S., & Hauck, W. W. (1983). A new procedure for testing equivalence in comparative bioavailability and other clinical trials. Communications in Statistics-Theory and Methods, 12(23), 2663-2692.
Other compare studies:
boot_compare_cor()
,
boot_compare_smd()
,
compare_smd()
# Example 1: Comparing two correlations (standard test)
compare_cor(r1 = 0.45, df1 = 48, r2 = 0.25, df2 = 58,
method = "fisher", alternative = "two.sided")
# Example 2: Testing for equivalence between correlations
# Testing if the difference between correlations is within ±0.15
compare_cor(r1 = 0.42, df1 = 38, r2 = 0.38, df2 = 42,
method = "fisher", alternative = "equivalence", null = 0.15)
# Example 3: Testing for minimal effects using Kraatz method
# Testing if the difference between correlations is outside ±0.2
compare_cor(r1 = 0.53, df1 = 28, r2 = 0.22, df2 = 32,
method = "kraatz", alternative = "minimal.effect", null = 0.2)
# Example 4: One-sided test (are correlations different in a specific direction?)
compare_cor(r1 = 0.65, df1 = 48, r2 = 0.45, df2 = 52,
method = "fisher", alternative = "greater")
# Example 5: Using asymmetric bounds for equivalence testing
compare_cor(r1 = 0.35, df1 = 48, r2 = 0.25, df2 = 52,
method = "fisher", alternative = "equivalence", null = c(-0.05, 0.2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.