corr.test {psych} | R Documentation |
Although the cor function finds the correlations for a matrix, it does not report probability values. corr.test uses cor to find the correlations for either complete or pairwise data and reports the sample sizes and probability values as well.
corr.test(x, y = NULL, use = "pairwise",method="pearson")
x |
A matrix or dataframe |
y |
A second matrix or dataframe with the same number of rows as x |
use |
use="pairwise" is the default value and will do pairwise deletion of cases. use="complete" will select just complete cases. |
method |
method="pearson" is the default value. The alternatives to be passed to cor are "spearman" and "kendall" |
corr.test uses the cor
function to find the correlations, and then applies a t-test to the individual correlations using the formula
t = r* sqrt(n-1)/sqrt(1-r^2)
r |
The matrix of correlations |
n |
Number of cases per correlation |
t |
value of t-test for each correlation |
p |
two tailed probability of t for each correlation |
cor.test
for tests of a single correlation, Hmisc::rcorr for an equivalant function, r.test
to test the difference between correlations, and cortest.mat
to test for equality of two correlation matrices.
data(sat.act) corr.test(sat.act)