parcor: Partial correlations

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
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

var, cor, correlations

Examples

1
2
3
4
### Partial correlations for the mathematics marks data
data(marks)
S <- var(marks)
parcor(S)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union


Attaching package: 'ggm'

The following object is masked from 'package:igraph':

    pa

               mechanics    vectors   algebra      analysis statistics
mechanics   1.0000000000 0.32846282 0.2292442 -0.0007121818 0.02550897
vectors     0.3284628169 1.00000000 0.2816015  0.0778303605 0.01996942
algebra     0.2292441885 0.28160149 1.0000000  0.4317713938 0.35673607
analysis   -0.0007121818 0.07783036 0.4317714  1.0000000000 0.25277656
statistics  0.0255089719 0.01996942 0.3567361  0.2527765574 1.00000000

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to parcor in ggm...