Skip to contents

Reports the higher-level random-effect correlation edge(s) — the between-unit coupling u_level,y1 <-> u_level,y2 among random effects sharing a grouping level (class 3 in docs/design/07-bivariate-covariance-edges.md). For an unfitted drm_pair() these are the declared corpair edges. For a drm_sem() they are read from drmTMB::corpairs() (non-residual rows only) when a joint bivariate fit is present; otherwise the declared higher-level edges are returned with estimate = NA. Residual rho12 is never mixed in — use rho12() for that.

Usage

corpairs(object, ...)

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

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

Arguments

object

A drm_pair or drm_sem.

...

Unused.

Value

A drm_corpairs data frame: level, y1, y2, estimate, std.error, p.value.

References

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

corpairs(drm_pair(activity ~ x + (1 | id), boldness ~ x + (1 | id)))
#> <higher-level correlation (corpair): 1 edge>
#>  level       y1       y2 estimate std.error p.value
#>     id activity boldness       NA        NA      NA
#> estimate NA: declaration only; fit the pair with drm_sem() or pass a bivariate
#> drmTMB fit to drm_psem().