Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Linear or rank correlation

`rho = corr(X)`

`rho = corr(X,Y)`

`[rho,pval] = corr(X,Y)`

`[rho,pval] = corr(___,Name,Value)`

`[`

specifies options using one or more name-value pair arguments in addition to the
input arguments in the previous syntaxes. For example,
`rho`

,`pval`

] = corr(___,`Name,Value`

)`'Type','Kendall'`

specifies computing Kendall's tau
correlation coefficient.

The difference between `corr(X,Y)`

and the MATLAB^{®} function `corrcoef(X,Y)`

is that
`corrcoef(X,Y)`

returns a matrix of correlation coefficients for
two column vectors `X`

and `Y`

. If
`X`

and `Y`

are not column vectors,
`corrcoef(X,Y)`

converts them to column vectors.

[1] Gibbons, J.D. *Nonparametric Statistical Inference.* 2nd
ed. M. Dekker, 1985.

[2] Hollander, M., and D.A. Wolfe. *Nonparametric Statistical
Methods*. Wiley, 1973.

[3] Kendall, M.G. *Rank Correlation Methods*. Griffin,
1970.

[4] Best, D.J., and D.E. Roberts. "Algorithm AS 89: The Upper Tail Probabilities of
Spearman's rho." *Applied Statistics*, 24:377-379.

`corrcoef`

| `corrcov`

| `partialcorr`

| `tiedrank`