Extract the partial correlation matrix (posterior mean) from estimate, explore, ggm_compare_estimate, and ggm_compare_explore objects. It is also possible to extract the partial correlation differences for ggm_compare_estimate and ggm_compare_explore objects.

pcor_mat(object, difference = FALSE, ...)

Arguments

object

A model estimated with BGGM. All classes are supported, assuming there is matrix to be extracted.

difference

Logical. Should the difference be returned (defaults to FALSE) ? Note that this assumes there is a difference (e.g., an object of class ggm_compare_estimate) and ignored otherwise.

...

Currently ignored.

Value

The estimated partial correlation matrix.

Examples

# \donttest{ # note: iter = 250 for demonstrative purposes # data Y <- ptsd[,1:5] + 1 # ordinal fit <- estimate(Y, type = "ordinal", iter = 250, progress = FALSE)
#> Warning: imputation during model fitting is #> currently only implemented for 'continuous' data.
pcor_mat(fit)
#> B1 B2 B3 B4 B5 #> B1 0.000 0.258 0.028 0.356 0.131 #> B2 0.258 0.000 0.517 -0.076 0.127 #> B3 0.028 0.517 0.000 0.246 0.202 #> B4 0.356 -0.076 0.246 0.000 0.349 #> B5 0.131 0.127 0.202 0.349 0.000
# }