There is a direct correspondence between the inverse covariance matrix and multiple regression (Kwan 2014; Stephens 1998) . This readily allows for converting the GGM paramters to regression coefficients. All data types are supported.
# S3 method for explore coef(object, iter = NULL, progress = TRUE, ...)
object | An Object of class |
---|---|
iter | Number of iterations (posterior samples; defaults to the number in the object). |
progress | Logical. Should a progress bar be included (defaults to |
... | Currently ignored. |
An object of class coef
, containting two lists.
betas
A list of length p, each containing a p - 1 by iter
matrix of
posterior samples
object
An object of class explore
(the fitted model).
Kwan CC (2014).
“A regression-based interpretation of the inverse of the sample covariance matrix.”
Spreadsheets in Education, 7(1), 4613.
Stephens G (1998).
“On the Inverse of the Covariance Matrix in Portfolio Analysis.”
The Journal of Finance, 53(5), 1821--1827.
# \donttest{ # note: iter = 250 for demonstrative purposes # data Y <- ptsd[,1:4] ########################## ### example 1: ordinal ### ########################## # fit model (note + 1, due to zeros) fit <- explore(Y + 1, type = "ordinal", iter = 250, progress = FALSE) # summarize the partial correlations reg <- coef(fit, progress = FALSE) # summary summ <- summary(reg) summ#> BGGM: Bayesian Gaussian Graphical Models #> --- #> Type: ordinal #> Formula: ~ 1 #> --- #> Call: #> explore(Y = Y + 1, type = "ordinal", iter = 250, progress = FALSE) #> --- #> Coefficients: #> #> B1: #> Node Post.mean Post.sd Cred.lb Cred.ub #> B2 0.289 0.078 0.134 0.445 #> B3 0.088 0.088 -0.076 0.256 #> B4 0.431 0.060 0.322 0.540 #> #> B2: #> Node Post.mean Post.sd Cred.lb Cred.ub #> B1 0.250 0.062 0.129 0.360 #> B3 0.598 0.080 0.448 0.741 #> B4 -0.046 0.072 -0.184 0.095 #> #> B3: #> Node Post.mean Post.sd Cred.lb Cred.ub #> B1 0.069 0.067 -0.055 0.198 #> B2 0.527 0.068 0.400 0.654 #> B4 0.304 0.068 0.182 0.445 #> #> B4: #> Node Post.mean Post.sd Cred.lb Cred.ub #> B1 0.430 0.063 0.316 0.556 #> B2 -0.055 0.084 -0.220 0.109 #> B3 0.397 0.090 0.219 0.554 #># }