Compute realized residual-scale Spearman rank correlation
Source:R/diagnostics-core.R
realized_rank_corr.RdCompute the realized Spearman rank correlation between the latent effect column and the per-site sampling variance. Group B diagnostic (realized dependence): "Did the simulated dataset reproduce the precision-dependence pattern I asked for?"
Usage
realized_rank_corr(x, on = c("residual", "marginal"))Details
on = "residual" (default) uses z_j — the design target of Layer 3
aligners. on = "marginal" uses tau_j — important when site-level
covariates contribute to the marginal correlation without affecting
the residual.
References
Lee, J., Che, J., Rabe-Hesketh, S., Feller, A., & Miratrix, L. (2025). Improving the estimation of site-specific effects and their distribution in multisite trials. Journal of Educational and Behavioral Statistics, 50(5), 731–764. doi:10.3102/10769986241254286 .
See also
realized_rank_corr_marginal for the marginal-scale
alias; align_rank_corr, align_copula_corr,
align_hybrid_corr for Layer 3 aligners this verifies;
the A3 Diagnostics
in practice vignette.
Other family-diagnostics:
bhattacharyya_coef(),
compute_I(),
compute_kappa(),
compute_shrinkage(),
default_thresholds(),
feasibility_index(),
heterogeneity_ratio(),
informativeness(),
ks_distance(),
mean_shrinkage(),
realized_rank_corr_marginal(),
scenario_audit()
Examples
dat <- sim_multisite(J = 50L, dependence = "rank", rank_corr = 0.3, seed = 1L)
realized_rank_corr(dat)
#> [1] 0.2999904
realized_rank_corr(dat, on = "marginal")
#> [1] 0.2999904