powered by
Adjust the cor.test function so that it can define the specific H0 as per your request, that is based on Fisher's Z transformation of the correlation.
cor.test
pearsonTest( x, y, h0 = 0, conf.level = 0.95, alternative = c("two.sided", "less", "greater"), ... )
a named vector contains correlation coefficient (cor), confidence interval(lowerci and upperci), Z statistic (Z) and p-value (pval)
cor
lowerci
upperci
Z
pval
(numeric) one measurement.
numeric
(numeric) another measurement.
(numeric) a specified hypothesized value of the difference between the two correlations, default is 0.
(numeric) significance level for the returned confidence interval and hypothesis.
(string) string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".
string
other arguments to be passed to cor.test().
cor.test()
NCSS correlation document
cor.test() to see the detailed arguments.
x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1) y <- c(2.6, 3.1, 2.5, 5.0, 3.6, 4.0, 5.2, 2.8, 3.8) pearsonTest(x, y, h0 = 0.5, alternative = "greater")
Run the code above in your browser using DataLab