Robust partial correlation of column variables of a numeric matrix
pcor(x, g = NULL, adjustment_type = "parents", ...)
matrix
related graph as adjacency matrix (optional)
character string for the method to define the adjustment set Z for the regression
additional arguments for function 'cor'
matrix of partial correlations
x <- matrix(rnorm(100),10,10)
pcor(x)
#> Warning: The inverse of variance-covariance matrix is calculated using Moore-Penrose generalized matrix invers due to its determinant of zero.
#> Warning: NaNs produced
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 1.0000000 -0.6467125 -0.63637079 -0.6244124 -0.7687934 -0.56080406
#> [2,] -0.6467125 1.0000000 -0.72978635 -0.5411871 -0.7321873 -0.70258200
#> [3,] -0.6363708 -0.7297864 1.00000000 -0.9042666 -0.9715299 -0.96743200
#> [4,] -0.6244124 -0.5411871 -0.90426658 1.0000000 -0.9343618 -0.86794537
#> [5,] -0.7687934 -0.7321873 -0.97152992 -0.9343618 1.0000000 -0.92981632
#> [6,] -0.5608041 -0.7025820 -0.96743200 -0.8679454 -0.9298163 1.00000000
#> [7,] -0.5806006 -0.6831761 -0.94047790 -0.8196644 -0.9123564 -0.96998181
#> [8,] -0.2338424 0.2217136 0.01449721 -0.3316499 -0.1615447 0.09039418
#> [9,] -0.1794622 -0.2014696 -0.63037987 -0.7719346 -0.6297530 -0.63131777
#> [10,] -0.7438693 -0.8155825 -0.95052984 -0.8588688 -0.9602956 -0.93079336
#> [,7] [,8] [,9] [,10]
#> [1,] -0.5806006 -0.23384243 -0.1794622 -0.74386934
#> [2,] -0.6831761 0.22171361 -0.2014696 -0.81558255
#> [3,] -0.9404779 0.01449721 -0.6303799 -0.95052984
#> [4,] -0.8196644 -0.33164991 -0.7719346 -0.85886880
#> [5,] -0.9123564 -0.16154472 -0.6297530 -0.96029559
#> [6,] -0.9699818 0.09039418 -0.6313178 -0.93079336
#> [7,] 1.0000000 0.11275562 -0.5648163 -0.91367561
#> [8,] 0.1127556 1.00000000 -0.3985827 -0.01204224
#> [9,] -0.5648163 -0.39858274 1.0000000 -0.50724552
#> [10,] -0.9136756 -0.01204224 -0.5072455 1.00000000