Note: This page has been translated by MathWorks. Please click here

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

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

Plot variable correlations

`corrplot(X)`

`corrplot(X,Name,Value)`

`R = corrplot(___)`

```
[R,PValue]
= corrplot(___)
```

`corrplot(`

creates
a matrix of plots showing correlations among pairs of variables in `X`

)`X`

.
Histograms of the variables appear along the matrix diagonal; scatter
plots of variable pairs appear off diagonal. The slopes of the least-squares
reference lines in the scatter plots are equal to the displayed correlation
coefficients.

`corrplot(`

uses
additional options specified by one or more `X`

,`Name,Value`

)`Name,Value`

pair
arguments.

returns
the correlation matrix of `R`

= corrplot(___)`X`

displayed in the plots.
You can use any of the previous input arguments.

The option

`'rows','pairwise'`

, which is the default, can return a correlation 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.Use

`gname`

to identify points in the plots.

The software computes:

*p*-values for Pearson’s correlation by transforming the correlation to create a*t*-statistic with`numObs`

– 2 degrees of freedom. The transformation is exact when`X`

is normal.*p*-values for Kendall’s and Spearman’s rank correlations using either the exact permutation distributions (for small sample sizes) or large-sample approximations.*p*-values for two-tailed tests by doubling the more significant of the two one-tailed*p*-values.

`collintest`

| `corr`

| `gname`

Was this topic helpful?