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 an unfitted drm_pair() it is the declared edge (estimate is NA). For a drm_sem() that holds a joint bivariate drmTMB fit it is the Wald table of rho12 coefficients: intercept and any rho12 ~ x predictors, with standard error and p-value, on the tanh (engine: atanh_guarded) link. Distinct from corpairs() (higher-level random-effect correlations) and kept out of paths() except for directed x -> rho12 paths.

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, term, estimate, std.error, statistic, p.value, link, predictors, constant.

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 term estimate std.error statistic p.value link predictors
#>  activity boldness <NA>       NA        NA        NA      NA tanh          x
#>  constant
#>     FALSE
#> estimate NA: declaration only; fit the pair with drm_sem() or pass a bivariate
#> drmTMB fit to drm_psem().