mqr.inference.correlation.
test#
- mqr.inference.correlation.test(x, y, H0_corr=0.0, alternative='two-sided')#
Hypothesis test on the Pearson correlation coefficient.
- Null-hypothesis
corr(x, y) == H0_corr
- Parameters:
- x, yarray_like
Test correlation of these two equal-length samples.
- H0_corrfloat, optional
Null-hypothesis correlation coefficient.
- alternative{‘two-sided’, ‘less’, ‘greater’}, optional
Sense of alternative hypothesis.
- Returns:
- Raises:
- ValueError
Length of x and y are different.
Notes
Chooses a method depending on the null-hypothesis. When the null-hypothesis correlation is zero, calculates a t-statistic according to Pearson. On the other hand, when the null-hypothesis correlation is non-zero, calculates a Gaussian statistic based on Fisher’s z-transform (see [1]).
References
[1]Asuero, A. G., Sayago, A., & González, A. G. (2006). The correlation coefficient: An overview. Critical reviews in analytical chemistry, 36(1), 41-59.