Skip to content

Commit ea7a42f

Browse files
Update references
1 parent 72fa740 commit ea7a42f

File tree

3 files changed

+129
-59
lines changed

3 files changed

+129
-59
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Authors@R: c(
1616
comment = c(ORCID = "0000-0002-9838-7308"))
1717
)
1818
Maintainer: Maarten Marsman <m.marsman@uva.nl>
19-
Description: Bayesian variable selection methods for analyzing the structure of a Markov Random Field model for a network of binary and/or ordinal variables. Details of the implemented methods can be found in: Marsman, van den Bergh, and Haslbeck (in press) <doi:10.31234/osf.io/ukwrf>.
19+
Description: Bayesian variable selection methods for analyzing the structure of a Markov Random Field model for a network of binary and/or ordinal variables. Details of the implemented methods can be found in: Marsman, van den Bergh, and Haslbeck (2025) <doi:10.31234/osf.io/ukwrf>.
2020
Copyright: Includes datasets 'ADHD' and 'Boredom', which are licensed under CC-BY 4. See individual data documentation for license and citation.
2121
License: GPL (>= 2)
2222
URL: https://Bayesian-Graphical-Modelling-Lab.github.io/bgms/
@@ -30,6 +30,7 @@ Depends:
3030
LazyData: true
3131
Encoding: UTF-8
3232
Suggests:
33+
ggplot2,
3334
knitr,
3435
qgraph,
3536
rmarkdown,

README.md

Lines changed: 121 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,88 @@
1-
<!-- badges: start -->
2-
[![CRAN Version](https://www.r-pkg.org/badges/version/bgms)](https://cran.r-project.org/package=bgms)
3-
[![Downloads](https://cranlogs.r-pkg.org/badges/bgms)](https://cran.r-project.org/package=bgms)
4-
[![Total](https://cranlogs.r-pkg.org/badges/grand-total/bgms)](https://cran.r-project.org/package=bgms)
5-
<!-- badges: end -->
61

72
# bgms: Bayesian Analysis of Networks of Binary and/or Ordinal Variables
83

9-
The R package <strong>bgms</strong> provides tools for Bayesian analysis of the ordinal Markov random field, a graphical model describing a network of binary and/or ordinal variables (Marsman, van den Bergh, & Haslbeck, in press). A pseudolikelihood is used to approximate the likelihood of the graphical model, and Markov chain Monte Carlo methods are used to simulate from the corresponding pseudoposterior distribution of the graphical model parameters.
10-
11-
The <strong>bgm</strong> function can be used for a one-sample design and the <strong>bgmCompare</strong> function can be used for an independent-sample design (see Marsman, Waldorp, Sekulovski, & Haslbeck, 2024). Both functions can model the selection of effects. In one-sample designs, the <strong>bgm</strong> function models the presence or absence of edges between pairs of variables in the network. The estimated posterior inclusion probability indicates how plausible it is that a network with an edge between the two corresponding variables produced the observed data, and can be converted into a Bayes factor test for conditional independence. The <strong>bgm</strong> function can also model the presence or absence of communities or clusters of variables in the network. The estimated posterior probability distribution of the number of clusters indicates how plausible it is that a network with the corresponding number of clusters produced the observed data, and can be converted into a Bayes factor test for clustering (see Sekulovski, Arena, Friel, & Marsman, 2025).
12-
In an independent-sample design, the <strong>bgmCompare</strong> function models the selection of group differences in edge weights and possibly category thresholds. The estimated posterior inclusion probability indicates how plausible it is that graphical models with a difference in the corresponding edge weight or category threshold generated the data at hand, and can be converted to a Bayes factor test for parameter equivalence.
4+
The `R` package <strong>bgms</strong> provides tools for Bayesian
5+
analysis of the ordinal Markov random field, a graphical model
6+
describing a network of binary and/or ordinal variables (Marsman, van
7+
den Bergh, and Haslbeck 2025). A pseudolikelihood is used to approximate
8+
the likelihood of the graphical model, and Markov chain Monte Carlo
9+
methods are used to simulate from the corresponding pseudoposterior
10+
distribution of the graphical model parameters.
11+
12+
The <strong>bgm</strong> function can be used for a one-sample design
13+
and the <strong>bgmCompare</strong> function can be used for an
14+
independent-sample design (see Marsman et al. 2024). Both functions can
15+
model the selection of effects. In one-sample designs, the
16+
<strong>bgm</strong> function models the presence or absence of edges
17+
between pairs of variables in the network. The estimated posterior
18+
inclusion probability indicates how plausible it is that a network with
19+
an edge between the two corresponding variables produced the observed
20+
data, and can be converted into a Bayes factor test for conditional
21+
independence. The <strong>bgm</strong> function can also model the
22+
presence or absence of communities or clusters of variables in the
23+
network. The estimated posterior probability distribution of the number
24+
of clusters indicates how plausible it is that a network with the
25+
corresponding number of clusters produced the observed data, and can be
26+
converted into a Bayes factor test for clustering (see Sekulovski et al.
27+
2025).
28+
29+
In an independent-sample design, the <strong>bgmCompare</strong>
30+
function models the selection of group differences in edge weights and
31+
possibly category thresholds. The estimated posterior inclusion
32+
probability indicates how plausible it is that graphical models with a
33+
difference in the corresponding edge weight or category threshold
34+
generated the data at hand, and can be converted to a Bayes factor test
35+
for parameter equivalence.
1336

1437
## Why use Markov Random Fields?
1538

16-
Multivariate analysis using graphical models has received much attention in the recent psychological and psychometric literature (Robinaugh et al., 2020; Marsman, & Rhemtulla, 2022; Contreras et al., 2019). Most of these graphical models are Markov Random Field (MRF) models, whose graph structure reflects the partial associations between variables (Kindermann, & Snell, 1980). In these models, a missing edge between two variables in the network implies that these variables are independent, given the remaining variables (Lauritzen, 2004). In other words, the remaining variables of the network fully account for the potential association between the unconnected variables.
39+
Multivariate analysis using graphical models has received much attention
40+
in the recent psychological and psychometric literature (Robinaugh et
41+
al. 2020; Marsman and Rhemtulla 2022; Contreras et al. 2019). Most of
42+
these graphical models are Markov Random Field (MRF) models, whose graph
43+
structure reflects the partial associations between variables
44+
(Kindermann and Snell 1980). In these models, a missing edge between two
45+
variables in the network implies that these variables are independent,
46+
given the remaining variables (Lauritzen 2004). In other words, the
47+
remaining variables of the network fully account for the potential
48+
association between the unconnected variables.
1749

1850
## Why use a Bayesian approach to analyze the MRF?
1951

20-
Testing the structure of the MRF in a one-sample design requires us to determine the plausibility of the opposing hypotheses of conditional dependence and conditional independence. That is, how plausible is it that the observed data come from a network with a structure that includes the edge between two variables compared to a network structure that excludes that edge? Similarly, testing for group differences in the MRF in an independent-samples design requires us to determine the plausibility of the opposing hypotheses of parameter difference and parameter equivalence. That is, how plausible is it that the observed data come from MRFs with differences in specific edge weights or threshold parameters compared to MRFs that do not differ in these parameter?
21-
22-
Frequentist approaches are limited in this respect because they can only reject, not support, null hypotheses of conditional independence or parameter equivalence. This leads to the problem that if an edge is excluded, we do not know whether this is because the edge is absent in the population or because we do not have enough data to reject the null hypothesis of independence. Similarly, if a difference is excluded, we do not know whether this is because there is no difference in the parameter between the different groups or because we do not have enough data to reject the null hypothesis of parameter equivalence.
23-
24-
To avoid this problem, we will advocate a Bayesian approach using Bayes factors. In one-sample designs, the inclusion Bayes factor (Huth et al., 2023; Sekulovski et al., 2024) allows us to quantify how much the data support both conditional dependence -<em>evidence of edge presence</em> - or conditional independence -<em>evidence of edge absence</em>. It also allows us to conclude that there is limited support for either hypothesis - an <em>absence of evidence</em>. In independent-sample designs, they can be used to quantify how much the data support the hypotheses of parameter difference and equivalence. The output of the <strong>bgm</strong> and <strong>bgmCompare</strong> functions can be used to estimate these inclusion Bayes factors.
52+
Testing the structure of the MRF in a one-sample design requires us to
53+
determine the plausibility of the opposing hypotheses of conditional
54+
dependence and conditional independence. That is, how plausible is it
55+
that the observed data come from a network with a structure that
56+
includes the edge between two variables compared to a network structure
57+
that excludes that edge? Similarly, testing for group differences in the
58+
MRF in an independent-samples design requires us to determine the
59+
plausibility of the opposing hypotheses of parameter difference and
60+
parameter equivalence. That is, how plausible is it that the observed
61+
data come from MRFs with differences in specific edge weights or
62+
threshold parameters compared to MRFs that do not differ in these
63+
parameter?
64+
65+
Frequentist approaches are limited in this respect because they can only
66+
reject, not support, null hypotheses of conditional independence or
67+
parameter equivalence. This leads to the problem that if an edge is
68+
excluded, we do not know whether this is because the edge is absent in
69+
the population or because we do not have enough data to reject the null
70+
hypothesis of independence. Similarly, if a difference is excluded, we
71+
do not know whether this is because there is no difference in the
72+
parameter between the different groups or because we do not have enough
73+
data to reject the null hypothesis of parameter equivalence.
74+
75+
To avoid this problem, we will advocate a Bayesian approach using Bayes
76+
factors. In one-sample designs, the inclusion Bayes factor (Huth et al.
77+
2023; Sekulovski et al. 2024) allows us to quantify how much the data
78+
support both conditional dependence -<em>evidence of edge
79+
presence</em> - or conditional independence -<em>evidence of edge
80+
absence</em>. It also allows us to conclude that there is limited
81+
support for either hypothesis - an <em>absence of evidence</em>. In
82+
independent-sample designs, they can be used to quantify how much the
83+
data support the hypotheses of parameter difference and equivalence. The
84+
output of the <strong>bgm</strong> and <strong>bgmCompare</strong>
85+
functions can be used to estimate these inclusion Bayes factors.
2586

2687
## Installation
2788

@@ -36,90 +97,96 @@ remotes::install_github("MaartenMarsman/bgms")
3697

3798
## References
3899

39-
<div id="refs" class="references csl-bib-body hanging-indent">
100+
<div id="refs" class="references csl-bib-body hanging-indent"
101+
entry-spacing="0">
40102

41103
<div id="ref-ContrerasEtAl_2019" class="csl-entry">
42104

43-
Contreras, A., Nieto, I., Valiente, C., Espinosa, R., & Vazquez, C. (2019).
44-
The study of psychopathology from the network analysis perspective: A
45-
systematic review. *Psychotherapy and Psychosomatics*, *88*(2), 71–83.
105+
Contreras, A., I. Nieto, C. Valiente, R. Espinosa, and C. Vazquez. 2019.
106+
The Study of Psychopathology from the Network Analysis Perspective: A
107+
Systematic Review.” *Psychotherapy and Psychosomatics* 88: 71–83.
46108
<https://doi.org/10.1159/000497425>.
47109

48110
</div>
49111

50112
<div id="ref-HuthEtAl_2023_intro" class="csl-entry">
51113

52-
Huth, K., de Ron, J., Goudriaan, A. E., Luigjes, K., Mohammadi, R., van Holst,
53-
R. J., Wagenmakers, E.-J., & Marsman, M. (2023). Bayesian analysis
54-
of cross-sectional networks: A tutorial in R and JASP.
55-
*Advances in Methods and Practices in Psychological Science*, *6*(4), 1–18.
114+
Huth, K., J. de Ron, A. E. Goudriaan, K. Luigjes, R. Mohammadi, R. J.
115+
van Holst, E.-J. Wagenmakers, and M. Marsman. 2023. “Bayesian Analysis
116+
of Cross-Sectional Networks: A Tutorial in R and JASP.*Advances in
117+
Methods and Practices in Psychological Science* 6: 1–18.
56118
<https://doi.org/10.1177/25152459231193334>.
57119

58120
</div>
59121

60122
<div id="ref-KindermannSnell1980" class="csl-entry">
61123

62-
Kindermann, R., & Snell, J. L. (1980).
63-
*Markov random fields and their applications* (Vol. 1).
64-
Providence: American Mathematical Society.
124+
Kindermann, R., and J. L. Snell. 1980. *Markov Random Fields and Their
125+
Applications*. Vol. 1. Contemporary Mathematics. Providence: American
126+
Mathematical Society.
65127

66128
</div>
67129

68130
<div id="ref-Lauritzen2004" class="csl-entry">
69131

70-
Lauritzen, S. L. (2004). *Graphical Models*. Oxford: Oxford University
132+
Lauritzen, S. L.. 2004. *Graphical Models*. Oxford: Oxford University
71133
Press.
72134

73135
</div>
74136

75-
76137
<div id="ref-MarsmanRhemtulla_2022_SIintro" class="csl-entry">
77138

78-
Marsman, M., & Rhemtulla, M. (2022). Guest editors’ introduction to the
79-
special issue ‘network psychometrics in action’: Methodological
80-
innovations inspired by empirical problems.” *Psychometrika*, *87*(1),
81-
1–11. <https://doi.org/10.1007/s11336-022-09861-x>.
139+
Marsman, M., and M. Rhemtulla. 2022. “Guest Editors’ Introduction to the
140+
Special Issue ‘Network Psychometrics in Action’: Methodological
141+
Innovations Inspired by Empirical Problems.” *Psychometrika* 87: 1–11.
142+
<https://doi.org/10.1007/s11336-022-09861-x>.
82143

83144
</div>
84145

85-
<div id="ref-MarsmanVandenBerghHaslbeck_inpress" class="csl-entry">
146+
<div id="ref-MarsmanVandenBerghHaslbeck_2024" class="csl-entry">
86147

87-
Marsman, M., van den Bergh, D. & Haslbeck, J. M. B. (in press). Bayesian
88-
analysis of the ordinal Markov random field. *Psychometrika*.
89-
<https://doi.org/10.1017/psy.2024.4>.
148+
Marsman, M., D. van den Bergh, and J. M. B. Haslbeck. 2025. “Bayesian
149+
Analysis of the Ordinal Markov Random Field.” *Psychometrika* 90:
150+
146--182.
90151

91152
</div>
92153

93154
<div id="ref-MarsmanWaldorpSekulovskiHaslbeck_2024" class="csl-entry">
94155

95-
Marsman, M., Waldorp, L. J., Sekulovski, N., & Haslbeck, J. M. B. (2024).
96-
A Bayesian independent samples *t* test for parameter differences in networks
97-
of binary and ordinal Variables.
98-
*Retrieved from <https://osf.io/preprints/osf/f4pk9>*. (OSF preprint.)
156+
Marsman, M., L. J. Waldorp, N. Sekulovski, and J. M. B. Haslbeck. 2024.
157+
A Bayesian Independent Samples $t$ Test for Parameter Differences in
158+
Networks of Binary and Ordinal Variables.*Retrieved from
159+
Https://Osf.io/Preprints/Osf/F4pk9*.
99160

100161
</div>
101162

102-
103163
<div id="ref-RobinaughEtAl_2020" class="csl-entry">
104164

105-
Robinaugh, D. J., Hoekstra, R. H. A., Toner, E. R., & Borsboom, D. (2020).
106-
The network approach to psychopathology: A review of the literature 2008–2018
107-
and an agenda for future research. *Psychological Medicine*,
108-
*50*(3), 353–366. <https://doi.org/10.1017/S0033291719003404>.
165+
Robinaugh, D. J., R. H. A. Hoekstra, E. R. Toner, and D. Borsboom. 2020.
166+
The Network Approach to Psychopathology: A Review of the Literature
167+
2008–2018 and an Agenda for Future Research.” *Psychological Medicine*
168+
50: 353–66. <https://doi.org/10.1017/S0033291719003404>.
109169

110170
</div>
111171

112-
<div id="ref-SekulovskiEtAl_2023" class="csl-entry">
172+
<div id="ref-SekulovskiEtAl_2025" class="csl-entry">
173+
174+
Sekulovski, N., G. Arena, J. M. B. Haslbeck, K. B. S. Huth, N. Friel,
175+
and M. Marsman. 2025. “A Stochastic Block Prior for Clustering in
176+
Graphical Models.” *Retrieved from
177+
<a href="https://osf.io/preprints/psyarxiv/29p3m_v1"
178+
class="uri">Https://Osf.io/Preprints/Psyarxiv/29p3m_v1</a>*.
113179

114-
Sekulovski, N., Keetelaar, S., Huth, K., Wagenmakers, E.-J., van Bork, R.,
115-
van den Bergh, D., & Marsman, M. (2024). Testing conditional independence in
116-
psychometric networks: An analysis of three bayesian methods.
117-
*Multivariate Behavioral Research*, *59*(5), 913–933. <https://doi.org/10.1080/00273171.2024.2345915>.
118180
</div>
119181

120-
<div id="ref-SekulovskiEtAl_2025" class="csl-entry">
182+
<div id="ref-SekulovskiEtAl_2024" class="csl-entry">
183+
184+
Sekulovski, N., S. Keetelaar, K. B. S. Huth, Eric-Jan Wagenmakers, R.
185+
van Bork, D. van den Bergh, and M. Marsman. 2024. “Testing Conditional
186+
Independence in Psychometric Networks: An Analysis of Three Bayesian
187+
Methods.” *Multivariate Behavioral Research* 59: 913–33.
188+
<https://doi.org/10.1080/00273171.2024.2345915>.
189+
190+
</div>
121191

122-
Sekulovski, N., Arena, G., Friel, N., & Marsman, M. (2025). Stochastic Block
123-
Models for Clustering in Psychological Networks. *Retrieved from <link>*.
124-
(OSF preprint.)
125192
</div>

inst/REFERENCES.bib

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ @article{MarsmanVandenBerghHaslbeck_2024
8080
author = {Marsman, M. and {van den} Bergh, D. and Haslbeck, J. M. B.},
8181
journal = {Psychometrika},
8282
title = {Bayesian analysis of the ordinal {M}arkov random field},
83-
year = {in press}}
83+
year = {2025},
84+
volume = {90},
85+
pages = {146–-182}}
8486

8587
@article{MarsmanWaldorpSekulovskiHaslbeck_2024,
8688
author = {Marsman, M. and Waldorp, L. J. and Sekulovski, N. and Haslbeck, J. M. B.},
@@ -130,9 +132,9 @@ @article{SekulovskiEtAl_2024
130132
bdsk-url-1 = {https://doi.org/10.1080/00273171.2024.2345915}}
131133

132134
@article{SekulovskiEtAl_2025,
133-
author = {Sekulovski, N. and Arena, G. and Friel, N. and Marsman, M.},
134-
journal = {Retrieved from "link"},
135-
title = {Stochastic Block Models for Clustering in Psychological Networks},
135+
author = {Sekulovski, N. and Arena, G. and Haslbeck, J. M. B. and Huth, K. B. S. and Friel, N. and Marsman, M.},
136+
journal = {Retrieved from \url{https://osf.io/preprints/psyarxiv/29p3m_v1}},
137+
title = {A Stochastic Block Prior for Clustering in Graphical Models},
136138
note = {OSF preprint},
137139
year = {2025}}
138140

0 commit comments

Comments
 (0)