Skip to contents

Convenience 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?").

Usage

realized_rank_corr_marginal(x, ...)

Arguments

x

A multisitedgp_data object.

...

Reserved for future extensions.

Value

A scalar double in [-1, 1], or NA_real_ when either margin is constant.

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 .

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