Learn R Programming

BGGM (version 1.0.0)

ggm_compare_bf: Compare GGMs with Bayesian Hypothesis Testing

Description

Compare GGMs with the Bayes factor. This method allows for assessing (relative) evidence for edge equality or edges differences across any number of groups. Further, confirmatory hypothesis testing can be used to test predictions or expectations regarding difference or similarities in different groups (e.g., male vs. female).

Usage

ggm_compare_bf(..., prior_sd = 0.35, iter = 25000, cores = 2)

Arguments

...

data matrices (n by p). Requires at least two.

prior_sd

hypothesized standard deviation for the edges or partial correlations.

iter

number of posterior samples.

cores

number of cores for parallel computing. The default is 2, but this can be adjusted.

Value

list of class ggm_compare_bf

  • BF_01 Bayes factors in favor of the null hypothesis

  • p number of variables

  • info list of information about the data matrices

    • dat list containing the data matrices

    • dat_info sample size for each data matrix

    • pairwise matrix of pairwise combinations

  • iter number of posterior and prior samples

  • call match.call()

  • delta hyperparameter of matrix-F prior distribution (corresponds to prior_sd)

  • groups number of groups

  • post_samps matrix of posterior samples

  • prior_samps matrix of prior samples

Examples

Run this code
# NOT RUN {
# assume null is true
Y1 <- MASS::mvrnorm(500, rep(0, 16), Sigma = diag(16))
Y2 <- MASS::mvrnorm(500, rep(0, 16), Sigma = diag(16))
Y3 <- MASS::mvrnorm(500, rep(0, 16), Sigma = diag(16))

bf_ggm <- ggm_compare_bf(Y1, Y2, Y3, prior_sd = .5, iter = 500, cores = 2)
# }

Run the code above in your browser using DataLab