parcor function

Partial correlations

Partial correlations

Finds the matrix of the partial correlations between pairs of variables given the rest.

parcor(S)

Arguments

  • S: a symmetric positive definite matrix, representing a covariance matrix.

Details

The algorithm computes c("sigmars/(sigmarr\n- \\sigma^{rs}/(\\sigma^{rr}\n", "sigmass)1/2 \\sigma^{ss})^{1/2}") where the σrs\sigma^{rs} are concentrations, i.e. elements of the inverse covariance matrix.

Returns

A symmetric matrix with ones along the diagonal and in position (r,s)(r,s) the partial correlation between variables rr

and ss given all the remaining variables.

References

Cox, D. R. & Wermuth, N. (1996). Multivariate dependencies. London: Chapman & Hall.

Author(s)

Giovanni M. Marchetti

See Also

var, cor, correlations

Examples

## for the mathematics marks data data(marks) S <- var(marks) parcor(S)