Skip to contents

There is a direct correspondence between the inverse covariance matrix and multiple regression kwan2014regression,Stephens1998BGGM. This readily allows for converting the GGM parameters to regression coefficients. All data types are supported.

Usage

# S3 method for class 'explore'
coef(object, iter = NULL, progress = TRUE, ...)

Arguments

object

An Object of class explore.

iter

Number of iterations (posterior samples; defaults to the number in the object).

progress

Logical. Should a progress bar be included (defaults to TRUE) ?

...

Currently ignored.

Value

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).

References

Examples

# \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.276   0.112   0.062   0.485
#>    B3     0.102   0.139  -0.182   0.358
#>    B4     0.408   0.088   0.222   0.544
#> 
#> B2: 
#>  Node Post.mean Post.sd Cred.lb Cred.ub
#>    B1     0.244   0.095   0.062   0.419
#>    B3     0.565   0.095   0.357   0.727
#>    B4    -0.027   0.107  -0.202   0.206
#> 
#> B3: 
#>  Node Post.mean Post.sd Cred.lb Cred.ub
#>    B1     0.083   0.108  -0.116   0.270
#>    B2     0.498   0.092   0.296   0.645
#>    B4     0.306   0.101   0.099   0.498
#> 
#> B4: 
#>  Node Post.mean Post.sd Cred.lb Cred.ub
#>    B1     0.402   0.087   0.221   0.567
#>    B2    -0.031   0.118  -0.256   0.213
#>    B3     0.386   0.121   0.125   0.590
#> 
# }