umg - Unified Model Graphs for Statistical Models in Psychology
Constructs, validates, lays out, and renders Unified Model
Graphs (UMG), a formal graphical grammar for statistical models
in psychology. Vertices are typed by observability, support,
and inferential role; edges distinguish stochastic, symmetric,
deterministic, and mixing dependence; plates encode replication
and hierarchy. Diagrams can be themed and rendered with base
'grid' graphics, with 'ggplot2', as 'TikZ' code, or as
'Graphviz' DOT, and can be constructed either from one-line
motif builders for many model families or automatically from
'lavaan', 'lme4', 'mirt', 'blavaan', 'brms', 'OpenMx', and
'qgraph' model objects. A diagram can be inspected as a data
frame, summarised, and exported back to 'lavaan' model syntax,
making the model-diagram correspondence operational in both
directions. Each diagram also exposes identification
diagnostics (scaling checks, a graphical counting rule, and a
d-separation reader) and generates the exploratory display
scaffolds implied by the model-data duality. The notation
builds on established results for graphical and structural
equation models: plate notation follows Buntine (1994)
<doi:10.1613/jair.62>; the counting rule and scaling checks
follow Bollen (1989) <doi:10.1002/9781118619179>; and the
independence reader implements the d-separation criterion of
Geiger, Verma and Pearl (1990) <doi:10.1002/net.3230200504>
through the equivalent ancestral graph criterion of Lauritzen,
Dawid, Larsen and Leimer (1990) <doi:10.1002/net.3230200503>.