c2pc: Calculate partial correlations from a correlation matrix

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

Description

'c2pc' is used to calculate partial correlations from a correlation matrix.

Usage

1
c2pc(Cin)

Arguments

Cin

A symmetric positive definite correlation matrix.

Details

If you obtain values not in [-1,1], your correlation matrix is not positive definite.

This routine only calculates partial correlations conditional on 1, 12, 123, 1234, etc.. Partial correlations conditional on other margins can be obtained by a permutation of margins.

Value

The partial correlations calculated will be

Theta =

12........13........14..........15...........16

..........23|1......24|1........25|1.........26|1

....................34|12.......35|12........36|12 ...

................................45|123.......46|123

.............................................56|1234

...

Author(s)

Vinzenz Erhardt

See Also

Package 'corpcor' calculates partial correlations conditional on ALL other margins.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# create 8 dimensional symmetric positive correlation matrix with random entries
Cin <- unstructured(8)
Cin

Theta <- c2pc(Cin)
Theta

# transform Theta back to obtain the correlation matrix
pc2c(Theta)

# identical with Cin
pc2c(Theta) - Cin

corcounts documentation built on May 29, 2017, 6 p.m.