Covariance edges of a distributional SEM (residual rho12 and higher-level corpair)
Source:R/covariances.R
covariances.RdReturns the covariance allowances declared via covary() — double-headed
arcs that are deliberately kept separate from paths() (which stays
directed-only, including any x -> rho12 directed path into the correlation
component). Residual (rho12, within-observation) and higher-level (corpair,
between-unit random-effect) edges are reported together with a class column
that distinguishes them; they answer different biological questions and are
never collapsed. A declared edge also makes basis_set() / dsep() drop the
y1 _||_ y2 independence claim.
Value
A drm_covariances data frame with columns y1, y2, class
("residual" / "higher_level"), level, structure, label.
References
Shipley B (2016). Cause and Correlation in Biology: A User's Guide to Path Analysis, Structural Equations and Causal Inference with R, 2nd edition. Cambridge University Press, Cambridge.
Bollen KA (1989). Structural Equations with Latent Variables. Wiley, New York.
Examples
if (FALSE) { # \dontrun{
sem <- drm_sem(
activity = drm_node(drmTMB::bf(activity ~ x), family = stats::gaussian()),
boldness = drm_node(drmTMB::bf(boldness ~ x), family = stats::gaussian()),
data = dat,
covariances = covary("activity", "boldness"))
covariances(sem) # the residual rho12 edge, reported separately from paths()
} # }