Calculates correlation coefficient between two variables and returns a list containing the correlation estimate, its standard error, the p-value of a null-hypothesis significance test, and the number of observations used.
Arguments
- x
a numeric vector.
- y
a numeric vector.
- ...
arguments passed to
cor.test()
.
Value
Returns a list with elements containing the correlation coefficient estimate, its associated standard error, the p-value of a null-hypothesis significance test, and the number of observations used, all as numeric vectors of length 1.
Details
Additional arguments to alter the type of null hypothesis significance test, the method used to
calculate the correlation coefficient, the confidence level, or other options should be passed to
correlate
() and will be inherited by cor.test()
. Note that unlike
cor.test()
, both arguments x
and y
are required.