Categories &

Functions List

Function Reference: partialcorri

statistics: rho = partialcorri (y, x)
statistics: rho = partialcorri (y, x, z)
statistics: [rho, pval] = partialcorri (…)
statistics: […] = partialcorri (…, Name, Value)

Partial correlation of each response with each predictor, adjusting for the remaining predictors.

rho = partialcorri (y, x) returns the sample partial correlation coefficients between the columns of the n-by-p response matrix y and the columns of the n-by-q predictor matrix x. Element rho(i,j) is the partial correlation between y(:,i) and x(:,j), adjusted for the other columns of x (that is, all columns of x except the j-th). rho is a p-by-q matrix.

rho = partialcorri (y, x, z) additionally controls for the variables in the n-by-r matrix z, so that rho(i,j) is adjusted for both the other columns of x and all columns of z.

[rho, pval] = partialcorri (…) also returns pval, a matrix of p-values for testing the hypothesis of no partial correlation against the alternative selected by 'Tail'.

The 'Type', 'Rows', and 'Tail' Name/Value options are accepted with the same meaning as in partialcorr. 'Kendall' is not supported and raises an error, as in MATLAB.

See also: partialcorr, corr, corrcoef, tiedrank

Source Code: partialcorri

Partial correlation of a response with each of two predictors, each adjusted for the other predictor.

 y = [-0.85; 0.33; 1.21; -0.19; 0.74; -1.44; 0.58; 0.02; 1.36];
 x = [0.42 1.30; 1.15 -0.47; -0.98 0.55; 0.63 2.10; 1.88 -1.02; ...
      -0.31 0.86; 0.77 0.14; -1.52 1.77; 0.29 -0.63];
 rho = partialcorri (y, x)
rho =

  -0.3218  -0.6239