| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
RHO = corr(X)
RHO = corr(X,Y,...)
[RHO,PVAL] = corr(...)
[...] = corr(...,param1,val1,param2,val2,...)
RHO = corr(X) returns a p-by-p matrix containing the pairwise linear correlation coefficient between each pair of columns in the n-by-p matrix X.
RHO = corr(X,Y,...) returns a p1-by-p2 matrix containing the pairwise correlation coefficient between each pair of columns in the n-by-p1 and n-by-p2 matrices X and Y.
[RHO,PVAL] = corr(...) also returns PVAL, a matrix of p-values for testing the hypothesis of no correlation against the alternative that there is a nonzero correlation. Each element of PVAL is the p-value for the corresponding element of RHO. If PVAL(i, j) is small, say less than 0.05, then the correlation RHO(i, j) is significantly different from zero.
[...] = corr(...,param1,val1,param2,val2,...) specifies additional parameters and their values. The following table lists the valid parameters and their values.
| Parameter | Values |
|---|---|
| 'type' |
|
| 'rows' |
|
| 'tail' — The alternative hypothesis against which to compute p-values for testing the hypothesis of no correlation |
|
Using the 'pairwise' option for the 'rows' parameter may return a matrix that is not positive definite. The 'complete' option always returns a positive definite matrix, but in general the estimates are based on fewer observations.
corr computes p-values for Pearson's correlation using a Student's t distribution for a transformation of the correlation. This correlation is exact when X and Y are normal. corr computes p-values for Kendall's tau and Spearman's rho using either the exact permutation distributions (for small sample sizes), or large-sample approximations.
corr computes p-values for the two-tailed test by doubling the more significant of the two one-tailed p-values.
[1] Gibbons, J.D. (1985) Nonparametric Statistical Inference, 2nd ed., M. Dekker.
[2] Hollander, M. and D.A. Wolfe (1973) Nonparametric Statistical Methods, Wiley.
[3] Kendall, M.G. (1970) Rank Correlation Methods, Griffin.
[4] Best, D.J. and D.E. Roberts (1975) "Algorithm AS 89: The Upper Tail Probabilities of Spearman's rho", Applied Statistics, 24:377-379.
corrcoef, partialcorr, corrcov, tiedrank
![]() | cordexch | corrcov | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |