Abstract
We derive sample-allocation formulas that maximize the power of several mediation tests in two-level–group-randomized studies under a linear cost structure and fixed budget. The results suggest that the optimal individual sample size is typically smaller than that associated with the detection of a main effect and is frequently less than 10 under parameter values commonly seen in the literature. However, the optimal sample allocation can be heavily influenced by the group-to-individual cost ratio, the ratio of the treatment-mediator to mediator-outcome path coefficients, and the outcome variance structure. We illustrate these findings with a hypothetical group-randomized trial examining a school-discipline reform policy. To encourage utilization of the sample allocation formulas we implement them in the R package PowerUpR and powerupr Shiny application.