Learn R Programming

ggm (version 0.5)

parcor: Partial correlations

Description

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

Usage

parcor(Smat)

Arguments

Smat
a symmetric positive definite matrix, representing a covariance matrix.

Value

  • A symmetric matrix with ones along the diagonal and in position $(r,s)$ the partial correlation between variables $r$ and $s$ given all the remaining variables.

Details

The algorithm computes $- \sigma^{rs}/(\sigma^{rr} \sigma^{ss})^{1/2}$ where the $\sigma$s are concentrations.

References

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

See Also

var, cor, correlations

Examples

Run this code
### Partial correlations for the mathematics marks data
data(marks)
S <- var(marks)
parcor(S)

Run the code above in your browser using DataLab