| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
RHO = partialcorr(X,Z)
RHO = partialcorr(X,Y,Z)
[RHO,PVAL] = partialcorr(...)
[...] = partialcorr(...,param1,val1,param2,val2,...)
RHO = partialcorr(X,Z) returns the sample linear partial correlation coefficients between pairs of variables in X controlling for the variables in Z. X is an n-by-p matrix, and Z is an n-by-q matrix with rows corresponding to observations, and columns corresponding to variables. The output, RHO, is a symmetric p-by-p matrix.
RHO = partialcorr(X,Y,Z) returns the sample linear partial correlation coefficients between pairs of variables between X and Y, controlling for the variables in Z. X is an n-by-p1 matrix, Y an n-by-p2 matrix, and Z is an n-by-q matrix, with rows corresponding to observations, and columns corresponding to variables. RHO is a p1-by-p2 matrix, where the (i, j)th entry is the sample linear partial correlation between the ith column in X and the jth column in Y.
If the covariance matrix of [X,Z] is
![]()
then the partial correlation matrix of X,
controlling for Z, can be defined formally as a
normalized version of the covariance matrix
![]()
[RHO,PVAL] = partialcorr(...) also returns PVAL, a matrix of p-values for testing the hypothesis of no partial correlation against the alternative that there is a nonzero partial 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 partial correlation, RHO(I,J), is significantly different from zero.
[...] = partialcorr(...,param1,val1,param2,val2,...) specifies additional parameters and their values. Valid parameter/value pars are listed in the following table.
| Parameter | Values |
|---|---|
| 'type' |
|
| 'rows' |
|
| 'tail' The alternative hypothesis against which to compute p-values for testing the hypothesis of no partial correlation. |
|
A 'pairwise' value for the rows parameter can produce a RHO that is not positive definite. A 'complete' value always produces a positive definite RHO, but when data is missing, the estimates will be based on fewer observations, in general.
partialcorr computes p-values for linear and rank partial correlations using a Student's t distribution for a transformation of the correlation. This is exact for linear partial correlation when X and Z are normal, but is a large-sample approximation otherwise.
![]() | paretotails | pcacov | ![]() |

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 |