Skip to contents

Reports the residual correlation edge(s) between two responses — the within-observation coupling rho12 that remains after each response's mean and scale (class 2 in docs/design/07-bivariate-covariance-edges.md). For a drm_pair() it is the declared edge; for a drm_sem() it is the declared residual covariance edges of the assembled model. The estimate is the fitted correlation read back from a live bivariate drmTMB fit — NA in the pure-R lane, since drmSEM never re-solves and the joint fit is the 0.4 engine step. Distinct from corpairs() (higher-level random-effect correlations) and kept out of paths() (any x -> rho12 directed path is reported there instead).

Usage

rho12(object, ...)

# S3 method for class 'drm_pair'
rho12(object, ...)

# S3 method for class 'drm_sem'
rho12(object, ...)

Arguments

object

A drm_pair or drm_sem.

...

Unused.

Value

A drm_rho12 data frame: y1, y2, predictors (of rho12 ~ x, or ""), constant, estimate.

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.

Brooks ME, Kristensen K, van Benthem KJ, Magnusson A, Berg CW, Nielsen A, Skaug HJ, Maechler M, Bolker BM (2017). “glmmTMB Balances Speed and Flexibility Among Packages for Zero-Inflated Generalized Linear Mixed Models.” The R Journal, 9(2), 378–400. doi:10.32614/RJ-2017-066 .

Examples

rho12(drm_pair(activity ~ x, boldness ~ x, rho12 = ~ x))
#> <residual correlation (rho12): 1 edge>
#>        y1       y2 predictors constant estimate
#>  activity boldness          x    FALSE       NA
#> estimate NA: rho12/corpair are declared; a joint bivariate drmTMB fit is needed
#> to read fitted values back (OQ-14, 0.4 engine).