Description Usage Arguments Details Value Author(s) See Also Examples
'c2pc' is used to calculate partial correlations from a correlation matrix.
1 | c2pc(Cin)
|
Cin |
A symmetric positive definite correlation matrix. |
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.
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
...
Vinzenz Erhardt
Package 'corpcor' calculates partial correlations conditional on ALL other margins.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.