Skip to contents

Compute the Neyman precision constant \(\kappa = (1/p + 1/(1 - p))(1 - R^2)\,\mathrm{Var}(Y)\) that maps per-site sample size to per-site sampling variance through \(\widehat{se}_j^2 = \kappa / n_j\). Use this to inspect or sweep \(\kappa\) for a planned design — compute_kappa() is also called internally by gen_site_sizes when constructing the Layer 2 SE column.

Usage

compute_kappa(p = 0.5, R2 = 0, var_outcome = 1)

Arguments

p

Numeric in (0, 1). Treatment-assignment proportion. Default 0.5 (balanced).

R2

Numeric in [0, 1). Covariate-explained variance share at the site level. Default 0.

var_outcome

Numeric (> 0). Outcome variance. Default 1.

Value

A numeric vector. Inputs are recycled by base R rules — pass scalars for a scalar \kappa, or matched vectors to sweep a grid.

Details

The defaults (p = 0.5, R2 = 0, var_outcome = 1) give \(\kappa = 4\), matching the JEBS reference design. Increasing R2 shrinks \(\kappa\) (covariates buy precision); imbalanced p inflates it.

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

# JEBS baseline: balanced assignment, no covariates, unit outcome variance.
compute_kappa()  # 4
#> [1] 4

# Covariates buy precision: kappa shrinks with R^2.
compute_kappa(p = 0.5, R2 = 0.2, var_outcome = 1)  # 3.2
#> [1] 3.2

# Imbalanced assignment inflates kappa.
compute_kappa(p = 0.3, R2 = 0, var_outcome = 1)  # ~ 4.76
#> [1] 4.761905