Skip to contents

drm_dag() captures a set of node formulas as one candidate causal model in a confirmatory model set, without fitting anything. Each argument is a node: a plain response ~ predictors formula, or a drmTMB::bf() / drmTMB::drm_formula() for a distributional node (so a candidate may posit arrows into sigma, zi, hu, ... as well as the mean). The response of each formula names the node. Models are fitted later by compare().

Usage

drm_dag(...)

Arguments

...

One formula per endogenous node. A bare response ~ predictors formula, or a drmTMB::bf() object for distributional parts. The node name is taken from the response.

Value

A drm_dag object: a list of captured node formulas.

References

van der Bijl W (2018). “phylopath: Easy Phylogenetic Path Analysis in R.” PeerJ, 6, e4718. doi:10.7717/peerj.4718 .

Lefcheck JS (2016). “piecewiseSEM: Piecewise Structural Equation Modelling in R for Ecology, Evolution, and Systematics.” Methods in Ecology and Evolution, 7(5), 573–579. doi:10.1111/2041-210X.12512 .

Examples

if (FALSE) { # \dontrun{
# mean-only candidate
drm_dag(size ~ temp, fitness ~ size + temp)
# distributional candidate: temp also drives residual scale of size
drm_dag(drmTMB::bf(size ~ temp, sigma ~ temp), fitness ~ size)
} # }