Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

parcor

Partial correlations


Description

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

Usage

parcor(S)

Arguments

S

a symmetric positive definite matrix, representing a covariance matrix.

Details

The algorithm computes - σ^{rs}/(σ^{rr} σ^{ss})^{1/2} where the σ^{rs} are concentrations, i.e. elements of the inverse 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.

Author(s)

Giovanni M. Marchetti

References

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

See Also

Examples

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

ggm

Graphical Markov Models with Mixed Graphs

v2.5
GPL-2
Authors
Giovanni M. Marchetti, Mathias Drton, Kayvan Sadeghi
Initial release
2020-02-014

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.