corr | R Documentation |
corr()
estimates Pearson correlation coefficients
among parametric numerical characteristics as follows:
The Pearson correlation coefficient:
\loadmathjax
\mjsdeqn
r_x,y = \fracn\sumxy-(\sumx)(\sumy)
\sqrt(n\sumx^2-(\sumx)^2)(n\sumy^2-(\sumy)^2)
or: \mjsdeqn r_x,y =\frac\Sigma(x-\barx)(y-\bary) \sqrt\Sigma(x-\barx)^2\Sigma(y-\bary)^2
where \mjseqnr_x,y is the correlation coefficient
between \mjseqnx and \mjseqny variables.
corr(datap, verbose = FALSE)
datap |
The data set |
verbose |
If |
The corr()
function estimates correlation coefficients
and their significance in the form of a table of one or
more independent (exogenous) variables on a dependent
(endogenous) variable along with testing the significance.
Returns a list of two objects:
the data frame of Pearson's correlation coefficients
the data frame of significance of correlation coefficients (r):
p
p-value for testing the r
lowCI
lower confidence interval of r
uppCI
upper confidence interval of r
Ali Arminian abeyran@gmail.com
correlation
data(dtsimp)
corr(dtsimp, verbose = FALSE)
data(dtraw)
corr(dtraw[, -1], verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.