Compute realized marginal-scale Spearman rank correlation
Source:R/diagnostics-core.R
realized_rank_corr_marginal.RdConvenience alias for realized_rank_corr(x, on = "marginal").
Computes the realized Spearman rank correlation between the
response-scale latent effect tau_j and the per-site sampling
variance se2_j. Group B diagnostic (realized dependence — Dr.
Chen's question 2: "Did the simulated dataset reproduce the
precision-dependence pattern I asked for, on the marginal scale?").
Details
Use this when you care about the dependence on the response-scale
latent effect after any covariate-adjusted shift, not just the
standardized residual z_j. When site-level covariates are present
(\(X\boldsymbol{\beta}\) entering tau_j), residual-scale and
marginal-scale Spearman can diverge — this alias surfaces the
marginal view.
For the residual-scale view (which matches the design target of
Layer 3 aligners), use realized_rank_corr with
on = "residual" (the default).
For the four-question diagnostic walkthrough see the A3 · Diagnostics in practice vignette.
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 (the underlying generic) for the
residual-vs-marginal contrast;
align_rank_corr, align_copula_corr,
align_hybrid_corr for the Layer 3 aligners this
diagnostic 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(),
scenario_audit()
Examples
# Marginal-scale realized correlation between tau_j and se2_j.
dat <- sim_multisite(J = 50L, seed = 1L)
realized_rank_corr_marginal(dat)
#> [1] 0.2557894