coef.estimate: Compute Regression Parameters for 'estimate' Objects

View source: R/coef.estimate.R

coef.estimateR Documentation

Compute Regression Parameters for estimate Objects

Description

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

Usage

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

Arguments

object

An Object of class estimate

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 estimate (the fitted model).

References

\insertAllCited

Examples


# note: iter = 250 for demonstrative purposes

#########################
### example 1: binary ###
#########################
# data
Y <- women_math[1:500, ]

# fit model
fit <- estimate(Y, type = "binary",
                iter = 250,
                progress = FALSE)

# summarize the partial correlations
reg <- coef(fit, progress = FALSE)

# summary
summ <- summary(reg)

summ


donaldRwilliams/BGGM documentation built on April 17, 2024, 5:52 p.m.