Package {easybgm}


Type: Package
Title: Extracting and Visualizing Bayesian Graphical Models
Version: 0.5.0
Maintainer: Karoline Huth <k.huth@uva.nl>
Description: Fit and visualize the results of a Bayesian analysis of networks commonly found in psychology. The package supports cross-sectional network models for ordinal, binary, continuous, and mixed data, fitted using the packages 'bgms' (default), 'BDgraph', and 'BGGM', as well as network comparison tests fitted using the packages 'bgms' and 'BGGM'. The package provides the parameter estimates, posterior inclusion probabilities, inclusion Bayes factor, and the posterior density of the parameters. In addition, for 'BDgraph' and 'bgms' it allows to assess the posterior structure space. Furthermore, the package comes with an extensive suite for visualizing results.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
URL: https://github.com/KarolineHuth/easybgm
BugReports: https://github.com/KarolineHuth/easybgm/issues
Encoding: UTF-8
Depends: R (≥ 4.1.0)
Imports: BDgraph, BGGM, bgms (≥ 0.1.6.3), dplyr, ggplot2, HDInterval, qgraph, coda
Suggests: testthat (≥ 3.2.3)
Config/testthat/edition: 3
Config/roxygen2/version: 8.1.0
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-09-10 11:02:27 UTC; karolinehuth
Author: Karoline Huth ORCID iD [aut, cre], Sara Keetelaar [ctb], Nikola Sekulovski [ctb], Gali Geller [ctb]
Repository: CRAN
Date/Publication: 2026-09-10 11:30:02 UTC

Plot of interaction parameters and their 95% highest density intervals

Description

Plots the 95% highest density interval of the posterior distribution of the parameter estimates. The plot can be used to visualize the uncertainty of the partial association estimates. The x-axis indicates the strength of the partial association. The y-axis indicates the edge between nodes $i$ and $j$. The farther the posterior estimates (i.e., the points in the plot) are from zero, the stronger the partial association of the edge. The wider the highest density intervals (i.e., the error bar around the point), the less certain we are about the strength of the association.

Usage

plot_parameterHDI(output, ...)

Arguments

output

Output object from the easybgm function. Supports also objects from the bgm function of the bgms package.

...

Additional arguments passed onto ggplot2

Value

Returns a plot

Examples

## Not run: 

library(easybgm)
library(bgms)


data <- na.omit(Wenchuan)
fit <- easybgm(data[1:50, 1:5], type = "ordinal",
              iter = 100,    # for demonstration only
              edge_selection = TRUE, save = TRUE)
plot_parameterHDI(fit)

## End(Not run)

Extract the results of a Bayesian analysis of networks

Description

Extract the results of a Bayesian analysis of networks

Usage

bgm_extract(fit, ...)

Arguments

fit

Fit object with a particular class that will dispatch to the respective package functions

...

Additional arguments to be passed onto the respective fitting functions


Fit a Bayesian analysis of networks

Description

Fit a Bayesian analysis of networks

Usage

bgm_fit(fit, ...)

Arguments

fit

Object with a particular class that will dispatch to the respective package functions

...

Additional arguments to be passed onto the respective fitting functions


Plot strength centralities and 95% highest density interval

Description

Visualize the strength centralities and their uncertainties. The centrality estimate can be obtained for each sample of the posterior distribution of the association parameters to obtain an estimate of the uncertainty of the strength centrality estimate.

Usage

plot_centrality(output, group_names = NULL, ...)

Arguments

output

One output object or a list of several output objects from the easybgm function. Supports also objects from the bgm function of the bgms package.

group_names

Specifying the group names, when providing a list of output objects. Needs to be a vector in the same length as the provided number of objects.

...

Additional arguments passed onto ggplot2

Value

Returns a plot

Examples


## Not run: 
library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)
fit <- easybgm(data[1:50, 1:5], type = "ordinal",
                iter = 100,    # for demonstration only
                edge_selection = TRUE, save = TRUE,
                centrality = TRUE)

plot_centrality(fit)

## End(Not run)

Test whether a network splits into clusters

Description

For a network fitted with the Stochastic Block Model (SBM) edge prior, this gives a Bayes factor for the number of clusters. With type = "complement" it weighs more than one cluster against exactly one; with type = "point" it weighs b1 clusters against b2. Values above 1 favour the first of the two; take the reciprocal to read the evidence the other way round.

Usage

clusterBayesfactor(fit, type = "complement", b1 = NULL, b2 = NULL)

Arguments

fit

A fit of class easybgm or bgms, fitted with edge_prior = bgms::sbm_prior(). Raw draws are used when the fit carries them, otherwise the stored summary, which must be at full precision.

type

Either "complement", the default, or "point".

b1, b2

Whole numbers between 1 and the number of variables, required when type = "point".

Details

The count is the number of clusters the model has available, which can be larger than the number that actually hold variables, since a cluster may come out empty. For the memberships themselves, see bgms::extract_sbm(). Evidence for clustering concerns the network's edge structure and is not by itself evidence of multidimensionality.

Value

A single unrounded Bayes factor. NA with a warning if neither point hypothesis appears in the posterior. A result of 0 or Inf means the sampler never visited one of the two, so run more iterations rather than reading it as decisive.


Plot posterior complexity probabilities

Description

Plots the posterior complexity probabilities of all visited structures, where complexity comprises the network density.

Usage

plot_complexity_probabilities(output, ...)

Arguments

output

Output object from the easybgm function. Supports also objects from the bgm function of the bgms package.

...

Additional arguments passed onto ggplot2

Value

Returns a plot

Examples

## Not run: 

library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)[1:50, 1:5]
fit <- easybgm(data, type = "ordinal", save = TRUE, edge_selection = TRUE,
                iter = 100   # for demonstration only
                )

plot_complexity_probabilities(fit)

## End(Not run)

Bayesian analysis of networks

Description

Easy estimation of a Bayesian graphical models to obtain conditional (in)dependence relations between variables in a network.

Usage

easybgm(
  data,
  type,
  package = NULL,
  save = FALSE,
  centrality = FALSE,
  iter = 1000,
  progress = TRUE,
  baseline_category = NULL,
  not_cont = NULL,
  ...
)

Arguments

data

An n x p matrix or dataframe containing the variables for n independent observations on p variables.

type

Specifies the type of data. There are two ways to use this argument:

1. A single string, applied to every variable:

  • "continuous": For continuous (Gaussian) data. Estimates a Gaussian Graphical Model (GGM).

  • "ordinal": For ordinal (Likert-type) data. Estimates an Ordinal Markov Random Field (OMRF).

  • "binary": For binary (0/1) data. Estimates an Ising model.

  • "blume-capel": For Blume-Capel ordinal data. Requires a reference category via the baseline_category argument.

  • "mixed": For data with both continuous and discrete variables. Requires the not_cont argument to indicate which variables are not continuous.

2. A character vector of length p (per-variable specification): Each element gives the type of the corresponding column of data, can be any of: "ordinal", "continuous", "blume-capel", and "binary". For example,type = c("ordinal", "ordinal", "continuous") specifies that the first two columns are ordinal and the third is continuous. Per-variable vectors are fitted by bgms and require bgms version 0.2.0.0 or later.

Data types and package support in the Details section below specifies which package will be used for which variable type.

package

The R-package used for fitting the network model. Optional. Supported options:

  • "bgms": Fits ordinal, binary, and blume-capel data, and – from bgms version 0.2.0.0 onwards – continuous data and per-variable type vectors as well.

  • "BDgraph": Fits continuous data (a GGM), mixed and ordinal data (a GCGM), and binary data (a discrete graphical model). For continuous data, missing values are not allowed; use na.omit() on the data first.

  • "BGGM": Fits continuous, mixed, ordinal, and binary data.

If package is not specified, bgms is used for all data types from bgms version 0.2.0.0 onwards. With bgms 0.1.6.3, bgms is used for binary, ordinal, and blume-capel data and BGGM for continuous and mixed data.

save

Logical. Should the posterior samples be obtained (default = FALSE)? If TRUE, the output includes a samples_posterior matrix with the posterior samples for each edge weight parameter. Setting centrality = TRUE automatically sets save = TRUE.

centrality

Logical. Should the strength centrality measures be extracted (default = FALSE)? Automatically sets save = TRUE.

iter

Number of iterations for the sampler. The default depends on the package:

  • bgms: 1e3 (1,000 iterations)

  • BDgraph: 1e4 (10,000 iterations)

  • BGGM: 1e4 (10,000 iterations)

The recommended number of iterations depends on the data, model complexity, and desired precision. Check the convergence diagnostics in the output to determine if more iterations are needed.

progress

Logical. Should a progress bar be shown (default = TRUE)?

baseline_category

Integer or vector, required if at least one variable is of type "blume-capel". Baseline category used in Blume–Capel variables. Can be a single integer (applied to all) or a vector of length p.

not_cont

A binary vector of length p, required whenever type = "mixed". Each element indicates whether the corresponding variable is not continuous (1 = not continuous/ordinal, 0 = continuous). This parameter is not required when specifying a variable vector with bgms.

...

Additional arguments passed to the fitting functions of the underlying packages (e.g., prior specifications). See the Prior specification section in Details for available prior options per package and the package help files for all other potential arguments.

Details

Data types and package support

BGGM and BDgraph fit continuous, mixed, ordinal and binary data; the Blume-Capel model and per-variable type vectors are fitted only by bgms. "Default" marks the package used when package is left unspecified. Because bgms 0.1.6.3 cannot fit continuous data, the bgms column is split by version:

Data type bgms >= 0.2.0.0 bgms 0.1.6.3 BDgraph BGGM
continuous Yes (default) No Yes Yes
ordinal Yes (default) Yes (default) Yes Yes
binary Yes (default) Yes (default) Yes Yes
blume-capel Yes (default) Yes (default) No No
mixed Yes (default) No Yes Yes
per-variable vector Yes No No No

Prior specification

Users may wish to deviate from the default (uninformative) prior specifications. This can be done by passing additional arguments via ... to the fitting function of the chosen package. We give an overview of the available prior arguments per package below.

bgms (>= 0.2.0.0) uses prior-constructor objects from the bgms package. Pass them through ...:

For backwards compatibility of bgms (< 0.2.0.0), the previous prior specifications are still accepted and translated into the relevant constructs. Check the previous bgms version for its prior arguments.

BDgraph:

BGGM:

We encourage researchers to conduct prior sensitivity checks.

Value

An object of class easybgm containing the following elements:

Always returned:

Returned for bgms and BDgraph:

Returned for bgms only:

Returned when edge_prior = "Stochastic-Block" (bgms only):

Interpretable parameter scales (bgms only):

In addition to the raw pairwise interaction parameters in parameters, the following transformations are provided when the model type supports them. They are NULL otherwise.

Returned for Blume-Capel variables (bgms >= 0.2.0.0):

Returned when save = TRUE:

Returned when centrality = TRUE:

Examples


library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)[1:50, 1:3]

# --- Continuous data (fitted by bgms >= 0.2.0.0, otherwise by BGGM) ---
fit <- easybgm(data, type = "continuous",
                iter = 100,   # for demonstration only; increase for real analyses
                # arguments from bgms to reduce the runtime of the example
                warmup = 50, chain = 2, cores = 1, precision_graph_prior = "joint"   
                )
summary(fit)

## Not run: 
# --- Mixed data using per-variable type vector (requires bgms >= 0.2.0.0) ---
if (utils::packageVersion("bgms") >= "0.2.0.0") {
  dat3 <- data[, 1:3]
  fit_vec <- easybgm(dat3,
                      type = c("ordinal", "ordinal", "continuous"),
                      iter = 100)
}

# --- Extract posterior samples and centrality ---
fit_full <- easybgm(data, type = "continuous",
                     iter = 100, 
                     centrality = TRUE, save = TRUE)

# --- Using BDgraph for continuous data ---
fit_bd <- easybgm(data, type = "continuous",
                   package = "BDgraph",
                   iter = 100)

# --- Using BGGM for continuous data ---
fit_bggm <- easybgm(data, type = "continuous",
                     package = "BGGM",
                     iter = 100)
                   

## End(Not run)

Compare networks across groups using Bayesian inference

Description

Easy comparison of networks using Bayesian inference to extract differences in conditional (in)dependence relations across groups.

Usage

easybgm_compare(
  data,
  type,
  package = NULL,
  not_cont = NULL,
  group_indicator = NULL,
  iter = 1000,
  save = TRUE,
  progress = TRUE,
  ...
)

Arguments

data

The data can be provided in two formats:

1. A list of two dataframes (two-group comparison): Each list element is an n x p matrix or dataframe for one group. The variables (columns) must be the same across both dataframes. This format is supported by both bgms and BGGM.

2. A single matrix or dataframe (multi-group comparison): An n x p matrix containing responses from all groups combined. Requires the group_indicator argument to specify which rows belong to which group. This format supports two or more groups and is only available with the bgms package.

type

Specifies the data type. Can be used in two ways:

1. A single string:

  • "continuous": For continuous data. Default package: BGGM.

  • "ordinal": For ordinal (Likert-type) data. Default package: bgms.

  • "binary": For binary (0/1) data. Default package: bgms.

  • "blume-capel": For Blume-Capel ordinal data. Requires baseline_category. Default package: bgms.

  • "mixed": For mixed data, requires not_cont. Default package: BGGM.

2. A character vector of length p (per-variable specification): Each element specifies the type of the corresponding column. Valid values are "ordinal", "blume-capel", and "binary"; note that "continuous" is not supported for group comparison with bgms. For example: type = c("ordinal", "ordinal", "blume-capel").

Per-variable vectors are fitted by bgms and require bgms version 0.2.0.0 or later.

package

The R-package used for fitting the comparison model, either "bgms" or "BGGM". If not specified, bgms is used for ordinal, binary, and blume-capel data, and BGGM for continuous and mixed data.

not_cont

A binary vector of length p, required when type = "mixed". Each element indicates whether the corresponding variable is not continuous (1 = not continuous/ordinal, 0 = continuous).

group_indicator

An integer vector of length n specifying group membership for each row in data. Required when data is a single matrix/dataframe (multi-group comparison). Supports two or more groups (e.g., rep(c(1, 2, 3), each = 50) for three groups of 50 observations each). Only available with the bgms package.

iter

Number of iterations for the sampler. The default is 1e4. The recommended number of iterations depends on the data and model complexity. Check convergence diagnostics in the output.

save

Logical. Should the posterior samples be obtained (default = TRUE)? If TRUE, the output includes a samples_posterior matrix with posterior samples for each difference parameter.

progress

Logical. Should a progress bar be shown (default = TRUE)?

...

Additional arguments passed to the fitting functions of the underlying packages (e.g., prior specifications). Consult the documentation of bgms and BGGM for the specific options available.

Details

Data types and package support for group comparison

Data type bgms BGGM
ordinal Yes (default) No
binary Yes (default) Yes
blume-capel Yes (default) No
continuous No Yes (default)
mixed No Yes (default)

Prior specification

Users may wish to adjust priors via the ... argument. We summarize the bgms options here and refer to bgmCompare and explore for full details.

bgms (>= 0.2.0.0)

For backwards compatibility of bgms (< 0.2.0.0), the previous prior specifications are still accepted and translated into the relevant constructs. Check the previous bgms version for its prior arguments.

We always encourage researchers to conduct prior sensitivity checks.

Value

An object of class easybgm_compare with the following elements:

Always returned:

Returned for bgms only:

Returned when save = TRUE:

Examples


## Not run: 
library(easybgm)
library(bgms)

data <- na.omit(ADHD)

# --- Two-group comparison (list input) ---
group1 <- data[1:10, 1:3]
group2 <- data[11:20, 1:3]

fit <- easybgm_compare(list(group1, group2),
                type = "binary", save = TRUE,
                iter = 100   # for demonstration only
                )
summary(fit)

# --- Multi-group comparison (single dataframe + group_indicator) ---
fit_multi <- easybgm_compare(data[1:80, 1:5],
                group_indicator = rep(c(1, 2, 3, 4), each = 20),
                type = "binary", save = TRUE,
                iter = 100   # for demonstration only
                )
summary(fit_multi)

## End(Not run)

Edge evidence plot

Description

The edge evidence plot colors edges according to their hypothesis testing results: blue for included, dashed + light blue for weakly included, dashed + gray for inconclusive, dashed + light yellow for weakly excluded, and yellow for excluded. This plot can be used to visualize the hypothesis testing results whether edge presence or absence. The edge evidence plot can aid researchers in deciding which edges provide robust inferential conclusions.

Usage

plot_edgeevidence(
  output,
  evidence_thresh = NULL,
  evidence_thresh_strong = 10,
  evidence_thresh_weak = 3,
  edge_legend = TRUE,
  split = FALSE,
  show = "all",
  ...
)

Arguments

output

Output object from the easybgm function. Supports also objects from the bgm function of the bgms package.

evidence_thresh

Deprecated. Use evidence_thresh_weak and evidence_thresh_strong.

evidence_thresh_strong

Bayes Factor which will be considered sufficient for strong in-/exclusion evidence, default is 10.

evidence_thresh_weak

Bayes Factor which will be considered sufficient for weak in-/exclusion evidence, default is 3

edge_legend

binary indicator specifying whether edge legend should be plotted. Default is TRUE.

split

if TRUE, plot is split in included and excluded edges. Note that by default separate plots are shown and appear after each other in the plot window. To show the plots side-by-side specify par(mfrow = c(1, 2)).

show

specifies which edges should be shown, indicated by "all", "included" for included and weakly included edges, "inconclusive", and "excluded" for excluded and weakly excluded edges.

...

Additional arguments passed onto qgraph.

Value

Returns a plot

Examples

## Not run: 
library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)[1:50, 1:5]
fit <- easybgm(data, type = "continuous",
                iter = 100   # for demonstration only
                )

plot_edgeevidence(fit)

oldpar <- par(mfrow = c(1,1))

par(mfrow = c(1, 2))
plot_edgeevidence(fit, split = TRUE)

#' par(mfrow = c(1, 3))
plot_edgeevidence(fit, show = "included")
plot_edgeevidence(fit, show = "inconclusive")
plot_edgeevidence(fit, show = "excluded")

par(oldpar)

## End(Not run)

Network plot

Description

The network plot visualizes the strength of interactions between two nodes, the partial associations. Solely edges with a posterior inclusion probability larger than the exc_prob argument (default = 0.5) are shown. Edge thickness and saturation represent the strength of the association; the thicker the edge, the stronger the association. Red edges indicate negative relations and blue edges indicate positive associations.

Usage

plot_network(
  output,
  exc_prob = 0.5,
  evidence_thresh = NULL,
  evidence_thresh_strong = 10,
  dashed = FALSE,
  partial_correlations = FALSE,
  ...
)

Arguments

output

Output object from the easybgm function. Supports also objects from the bgm function of the bgms package.

exc_prob

The threshold for excluding edges. All edges with a lower inclusion probability will not be shown. The default is set to 0.5 in line with the median probability plot.

evidence_thresh

Deprecated. Use evidence_thresh_weak and evidence_thresh_strong.

evidence_thresh_strong

If dashed = TRUE, users can specify the threshold for evidence for inclusion. All edges with evidence lower than evidence_thresh_strong are dashed. Default is 10.

dashed

A binary parameter indicating whether edges with inconclusive evidence should be dashed. Default is FALSE

partial_correlations

A binary parameter indicating whether edges should show partial correlations instead of partial associations for continuous models fit with bgms. Default is FALSE.

...

Additional arguments passed onto qgraph.

Value

Returns a plot

Examples


## Not run: 
library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)[1:50, 1:5]
fit <- easybgm(data, type = "continuous",
                iter = 100   # for demonstration only
                )

plot_network(fit)

# Shows all edges with an inclusion probability larger than 0.1
plot_network(fit, exc_prob = 0.1)

# Indicate which edges have insufficient evidence for inclusion through a dashed line
plot_network(fit, dashed = TRUE, evidence_thresh_strong = 10)

## End(Not run)

Print method for easybgm objects

Description

Used to print easybgm results. The nicest overview is created by first feeding it to summary()

Usage

## S3 method for class 'easybgm'
print(x, ...)

Arguments

x

easybgm object

...

unused argument

Value

Prints the output of a Bayesian cross-sectional network model fitted with 'easybgm'


Print method for easybgm_compare objects

Description

Used to print easybgm results. The nicest overview is created by first feeding it to summary()

Usage

## S3 method for class 'easybgm_compare'
print(x, ...)

Arguments

x

easybgm_compare object

...

unused argument

Value

Prints the output of a Bayesian cross-sectional network comparison fitted with 'easybgm'


Plot sensitivity to edge inclusion prior setting

Description

For a given list of easybgm outputs with different prior edge inclusion probabilities, the function plots the percentage of edges that are included, excluded, and inconclusive.

Usage

plot_prior_sensitivity(
  output,
  evidence_thresh_strong = 10,
  evidence_thresh_weak = 3,
  ...
)

Arguments

output

A list of easybgm outputs with different prior edge inclusion probabilities

evidence_thresh_strong

Bayes Factor which will be considered sufficient for strong in-/exclusion evidence, default is 10.

evidence_thresh_weak

Bayes Factor which will be considered sufficient for weak in-/exclusion evidence, default is 3

...

Additional arguments passed onto ggplot2.

Details

Prior sensitivity plot

Value

Returns a plot

Examples


## Not run: 
library(easybgm)
library(bgms)

#data <- na.omit(Wenchuan)
#fit1 <- easybgm(data[1:50, 1:5], type = "ordinal",
#               iter = 100,  # for demonstration only
#               inclusion_probability = .1
#               )
#fit2 <- easybgm(data[1:50, 1:5], type = "ordinal",
#                  iter = 100,
#                  inclusion_probability = .5
#             )
#fit3 <- easybgm(data[1:50, 1:5], type = "ordinal",
#                iter = 100, inclusion_probability = .9)

#plot_prior_sensitivity(list(fit1, fit2, fit3))

## End(Not run)

Structure plot

Description

The plot shows the resulting graph structure, i.e. all edges with some evidence of inclusion (i.e., inclusion Bayes factor greater than 1).

Usage

plot_structure(output, ...)

Arguments

output

Output object from the easybgm function. Supports also objects from the bgm function of the bgms package.

...

Additional arguments passed onto qgraph

Value

Returns a plot

Examples

## Not run: 

library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)
fit <- easybgm(data[1:50, 1:5], type = "ordinal",
                iter = 100   # for demonstration only
               )

plot_structure(fit)

## End(Not run)

Plot Posterior Structure Probabilities

Description

Plots the posterior structure probabilities of all visited structures, sorted from the most to the least probable.

Usage

plot_structure_probabilities(output, as_BF = FALSE, ...)

Arguments

output

Output object from the easybgm function. Supports also objects from the bgm function of the bgms package.

as_BF

If TRUE plots the y-axis as Bayes factors instead of posterior structure probability. Default is FALSE.

...

Additional arguments passed onto ggplot2

Value

Returns a plot

Examples

## Not run: 

library(easybgm)
library(bgms)

data <- na.omit(Wenchuan)[1:50, 1:5]
fit <- easybgm(data, type = "ordinal", save = TRUE, edge_selection = TRUE,
                iter = 100   # for demonstration only
                )

plot_structure_probabilities(fit)

## End(Not run)

Summary method for easybgm objects

Description

Used to create a object of easybgm results and in turn print it

Usage

## S3 method for class 'easybgm'
summary(
  object,
  evidence_thresh = NULL,
  evidence_thresh_weak = 3,
  evidence_thresh_strong = 10,
  BF_uncertainty = FALSE,
  ...
)

Arguments

object

easybgm object

evidence_thresh

Deprecated. Use evidence_thresh_weak and evidence_thresh_strong.

evidence_thresh_weak

Bayes Factor which will be considered sufficient for weak in-/exclusion evidence, default is 3

evidence_thresh_strong

Bayes Factor which will be considered sufficient for strong in-/exclusion evidence, default is 10.

BF_uncertainty

Whether the MC uncertainty estimates for the Bayes factors should be included in the output (only for bgms package)

...

unused argument

Value

Creates and prints the output of a Bayesian cross-sectional network analysis. The summary output has four parts. The first part lists the package used, the number of variables, and the data type. The second part is a matrix of edge-specific information. Each edge is listed in a row. This row contains the posterior parameter estimate, the posterior inclusion probability, the inclusion Bayes factor, and the categorization of the edge. The category encodes whether an edge is included, excluded, or inconclusive based on the inclusion Bayes factor. Users can set the threshold for the Bayes factor classification with the evidence threshold. By default, the threshold is set to 10. The third part of the summary provides aggregated edge information. It lists the number of included, excluded, and inconclusive edges in the network, as well as the number of possible edges. This gives the user a quick overview of the robustness and density of the network. The higher the number of conclusive edges (i.e., classified as either included or excluded), the more robust the network. Conversely, if the network has a high percentage of inconclusive edges, the network is not robust. Researchers should refrain from making strong inferential conclusions. The final output section is a description of the structure uncertainty. It shows the number of structures visited, the number of possible structures, and the highest posterior structure probability. This last section can only be obtained for networks fitted with 'BDgraph' and 'bgms'.


Summary method for easybgm_compare objects

Description

Used to create a object of easybgm results and in turn print it

Usage

## S3 method for class 'easybgm_compare'
summary(
  object,
  evidence_thresh = NULL,
  evidence_thresh_weak = 3,
  evidence_thresh_strong = 10,
  ...
)

Arguments

object

easybgm_compare object

evidence_thresh

Deprecated. Use evidence_thresh_weak and evidence_thresh_strong.

evidence_thresh_weak

Bayes Factor which will be considered sufficient for weak in-/exclusion evidence, default is 3

evidence_thresh_strong

Bayes Factor which will be considered sufficient for strong in-/exclusion evidence, default is 10.

...

unused argument

Value

Creates and prints the output of a Bayesian cross-sectional network analysis. The summary output has four parts. The first part lists the package used, the number of variables, and the data type. The second part is a matrix of edge-specific information. Each edge is listed in a row. This row contains the posterior parameter estimate, the posterior inclusion probability, the inclusion Bayes factor, and the categorization of the edge. The category encodes whether an edge is included, excluded, or inconclusive based on the inclusion Bayes factor. Users can set the threshold for the Bayes factor classification with the evidence threshold. By default, the threshold is set to 10. The third part of the summary provides aggregated edge information. It lists the number of included, excluded, and inconclusive edges in the network, as well as the number of possible edges. This gives the user a quick overview of the robustness and density of the network. The higher the number of conclusive edges (i.e., classified as either included or excluded), the more robust the network. Conversely, if the network has a high percentage of inconclusive edges, the network is not robust. Researchers should refrain from making strong inferential conclusions. The final output section is a description of the structure uncertainty. It shows the number of structures visited, the number of possible structures, and the highest posterior structure probability. This last section can only be obtained for networks fitted with 'BDgraph' and 'bgms'.

mirror server hosted at Truenetwork, Russian Federation.