Description Usage Arguments Value Note References
Compute a 1-alpha percentile bootstrap confidence interval for the difference between two correlation coefficients corresponding to two independent groups. The default correlation is the percentage bend. When using Pearson's correlation, the confidence interval is adjusted to compensate for the error term's heteroscedasticity. Missing values are automatically removed.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x1, y1 |
Two dependent vectors of the same length from group 1. |
x2, y2 |
Two dependent vectors of the same length from group 2. |
method |
A function that returns a correlation coefficient.
Options in |
nboot |
Number of bootstrap samples. Default 2000. |
alpha |
Alpha level. Default 0.05. For corfun = pearson, alpha is restricted to 0.05 because the confidence interval adjustments have not been calculated for other alphas. |
alternative |
Type of test, either "two.sided" (default), "greater" for positive correlations, or "less" for negative correlations. |
null.value |
Hypothesis to test. Default 0. |
saveboot |
Option to save bootstrap samples. Default TRUE. |
... |
Optional parameter to pass to correlation function. |
estimate1
the correlation coefficient for group 1.
estimate2
the correlation coefficient for group 2.
difference
the difference between correlation coefficients.
conf.int
the bootstrap confidence interval.
p.value
the bootstrap p value.
bootsamples
the bootstrap samples.
Modified from functions twocor
and twopcor
from Rallfun-v37.txt - see https://github.com/nicebread/WRS/ and
http://dornsife.usc.edu/labs/rwilcox/software/.
Wilcox, R.R. (2009) Comparing Pearson Correlations: Dealing with Heteroscedasticity and Nonnormality. Communications in Statistics - Simulation and Computation, 38, 2220–2234.
Wilcox, R.R. (2017) Introduction to Robust Estimation and Hypothesis Testing, 4th edition. Academic Press.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.