cor.all | R Documentation |
Computes correlations among numeric data.
cor.all(data, method = "pearson", na.method = "pairwise", distribution = "normal")
data |
any rectangular object such as a data.frame or matrix. |
method |
a character string indicating which correlation coefficient is to be used. One of "pearson," "kendall," or "spearman," can be abbreviated. |
na.method |
a character string indicating which method to use for missing values. One of "fail," "omit," "pairwise," can be abbreviated. |
distribution |
a character string indicating the assumed distribution of the data. One of "normal," "lognormal," or "log1p", which can be abbreviated. |
The null hypothesis is that the data are not correlated with one another.
The alternate hypothesis is that they are correlated with one another. This
is a two-sided test. For other options, see cor.all
.
If method
is "pearson," then the correlation is based on Pearson's
product moment correlation coefficient. If method
is "kendall," then
Kendall's tau is used to estimate a rank-based measure of association. If
method
is "spearman", then Spearman's rho is used to estimate the
correlation of the ranks of the data. The last two methods may be used if
the data do not necessarily come from a bivariate normal distribution.
If na.method
is "fail," then cor.all
stops if there are any
missing numeric values. If it is "omit," then all rows with any missing
values is removed before the correlations are computed. That option will
always produce a correlation matrix that is positive definite. If
na.method
is "pairwise," then missing values are removed from each
pairwise correlation.
If distribution
is "normal," then the assumption for method
=
"pearson" is that the data are bivariate normal. If distribution
is
"lognormal," then the assumption for method
= "pearson" is that the
data are bivariate log-normal and all data are natural log-transformed. If
distribution
is "log1p," then the assumption for method
=
"pearson" is that the data are bivariate log-normal after adding 1 and all
data are transformed using the log1p
function. The data are
transformed for any method
, but only produce a different result for
method
= "pearson."
An object of class "cor.all," which has these components:
estimates |
a matrix of the correlations between each pair of numeric
variables in |
p.values |
a matrix of the attained
p-values between each pair of numeric variables in |
counts |
a matrix of observations in each pair of numeric variables in
|
alternative |
a character string indicating the alternative hypothesis, always "two.sided" |
na.method |
a character string indicating the method to handle missing values |
method |
a character string describing the method to compute the correlations |
data.name |
the name of the data set, derived from |
data |
a data frame of the numeric variables |
call.method |
a character string indicating the method to compute the correlations |
distribution |
a character string indicating the distribution assumption of the data |
The print
, plot
, and summary
methods are
available for an object of class "cor.all."
Conover, W.J., 1980, Practical nonparametric statistics (2d
ed.): New York, Wiley, 512 p.
Helsel, D.R. and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.
cor.test
, plot.cor.all
,
summary.cor.all
## Not run: library(smwrData) data(TNLoads) cor.all(TNLoads[, 1:5]) cor.all(TNLoads, method="spearman") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.