Learn R Programming

BGGM (version 1.0.0)

plot.select.ggm_compare_bf: Plot select.ggm_compare_bf Objects

Description

This function plots the selected graph when comparing GGMs with Bayesian hypothesis testing. There are two heatmap plots in total. The first includes egdes for which there was evidence for a diffirence. The second includes edges for which there is evidence for the null hypothesis of equality. The tiles in the heatmap correspond to the Bayes factor

Usage

# S3 method for select.ggm_compare_bf
plot(
  x,
  H0_low = "lightblue",
  H0_high = "purple",
  H1_low = "yellow",
  H1_high = "red",
  ...
)

Arguments

x

object of class select.ggm_compare_bf

H0_low

tile color for the smallest Bayes factors in the null hypothesis heatmap

H0_high

tile color for the largest Bayes factors in the null hypothesis heatmap

H1_low

tile color for the smallest Bayes factors in the alternative hypothesis heatmap

H1_high

tile color for the largest Bayes factors in the alternative hypothesis heatmap

...

currently ignored

Value

list containing two ggplot objects

Examples

Run this code
# NOT RUN {
# group 1
Y1 <- MASS::mvrnorm(500, mu = rep(0,16),
                    Sigma =  BGGM::ptsd_cor2,
                    empirical = FALSE)

# group 2
Y2 <- MASS::mvrnorm(500, mu = rep(0,16),
                    Sigma =  BGGM::ptsd_cor2,
                    empirical = FALSE)
# fit model
fit <- ggm_compare_bf(Y1, Y2,
                     prior_sd = 0.20,
                     iter = 50,
                     cores = 2)
# select E
E <- select(fit, BF_cut = 3)

# plot E
plot(E)
# }

Run the code above in your browser using DataLab