rho12() returns the residual response-response correlation from a
bivariate Gaussian drmTMB fit. By default it returns the response-scale
correlation. Use type = "link" for the Fisher-z-like linear predictor
whose response transform is 0.999999 * tanh(eta).
Usage
rho12(object, ...)
# S3 method for class 'drmTMB'
rho12(object, newdata = NULL, type = c("response", "link"), ...)Value
A numeric vector of residual correlations, or Fisher-z-like linear
predictors when type = "link".
Examples
set.seed(20260525)
n <- 36
x <- seq(-1, 1, length.out = n)
e1 <- rnorm(n)
e2 <- 0.4 * e1 + sqrt(1 - 0.4^2) * rnorm(n)
dat <- data.frame(
y1 = 0.2 + 0.5 * x + e1,
y2 = -0.1 + 0.3 * x + e2,
x = x
)
fit <- drmTMB(
bf(mu1 = y1 ~ x, mu2 = y2 ~ x, sigma1 = ~ 1, sigma2 = ~ 1, rho12 = ~ x),
family = biv_gaussian(),
data = dat
)
head(rho12(fit))
#> [1] 0.2914193 0.2982033 0.3049573 0.3116808 0.3183732 0.3250340
rho12(fit, newdata = data.frame(x = c(-0.5, 0, 0.5)))
#> [1] 0.3497222 0.4054364 0.4582930