Skip to contents

Building a distributional SEM

Assemble a piecewise SEM from drmTMB nodes.

drm_node()
Specify one endogenous node of a distributional SEM
drm_sem()
Fit and assemble a distributional piecewise SEM
drm_psem() summary(<drm_sem>)
Assemble a distributional piecewise SEM from fitted drmTMB models

Graph and paths

Inspect the component-labelled structural graph.

paths()
Component-labelled path table for a distributional SEM
standardize()
Standardized component-labelled path coefficients
plot(<drm_sem>)
Plot the distributional SEM as a component-labelled DAG

Covariance edges (bivariate)

Declare and inspect residual (rho12) and higher-level (corpair) covariance edges, and declare a bivariate (joint two-response) node. The joint fit that estimates rho12 is the 0.4 engine step; the grammar and accessors are pure-R.

covary()
Declare a covariance edge between two responses
covariances()
Covariance edges of a distributional SEM (residual rho12 and higher-level corpair)
drm_pair()
Declare a bivariate (joint two-response) node
drm_expand_pair()
Expand a bivariate pair onto the covariance-edge grammar
rho12()
Residual response-response correlation (rho12)
corpairs()
Higher-level random-effect correlations (corpairs)

Latent constructs

Build composite (formative) constructs from observed indicators.

drm_composite()
Declare a composite construct from observed indicators
loadings()
Indicator loadings of a SEM's composite constructs

Feedback / cyclic motifs

Declare a feedback motif so specific cycles are allowed (every undeclared cycle stays an error). The equilibrium effect engine and consistent estimation are staged in docs/design/10-cyclic-feedback.md.

drm_cycle()
Declare a feedback (cyclic) motif
cycles()
Declared feedback motifs of a distributional SEM

d-separation

Test missing arrows on any distributional component.

basis_set()
Basis set of independence claims for a distributional SEM
dsep()
Test directed-separation claims by likelihood-ratio refits
fisher_c()
Fisher's C statistic for a fitted distributional SEM

Effects

Simulation-based direct, indirect, and total effects.

direct_effects()
Response-scale direct (controlled) effect of a predictor on a node
indirect_effects()
Indirect effect of a predictor on a node, with a distributional decomposition
total_effects()
Total effect of a predictor on a node by simulation
path_effects()
Path-specific (per-mediator) decomposition of an indirect effect
plot(<drm_effect>)
Plot an effect decomposition as a forest plot

Symbolizer integration

Render per-node equations from fitted drmSEM objects.

symbolize(<drm_sem>)
Symbolize a distributional piecewise SEM
as_latex(<symbolized_drm_sem>) equations(<symbolized_drm_sem>) assumption_table(<symbolized_drm_sem>)
Render the symbolized SEM as LaTeX, equations, or an assumption table

Model comparison

Compare competing causal DAGs by Fisher’s C / CBIC.

drm_dag()
Specify a candidate causal model (an unfitted DAG)
drm_model_set()
Assemble a set of candidate causal models
compare()
Fit and rank a set of candidate causal models
best()
Best-supported candidate model
average()
Criterion-weighted average of standardized path coefficients

Interop (graph interchange)

Translate a drmSEM graph to/from neighbouring ecosystems’ text formats (lavaan model syntax, Graphviz DOT). Graph interchange only — drmSEM never fits its own likelihoods, and non-mean (distributional-component) paths are dropped-with-notice when emitting lavaan syntax, never misrepresented as a mean regression.

as_lavaan()
Export a distributional SEM as lavaan model syntax
from_lavaan()
Parse lavaan model syntax into a drmSEM graph skeleton
as_dot()
Export a distributional SEM as Graphviz DOT

Phylogenetic SEM

Build evolutionary covariance matrices for phylogenetic nodes.

drm_phylo_cov()
Build an evolutionary phylogenetic covariance / relatedness matrix

Diagnostics

check_sem()
Diagnose a fitted distributional SEM