Design Parameters for Socio-Emotional Learning Outcomes
  • Database of Design Parameters
  • OSM A: Materials and Methods
  • OSM B: R Application Demo

On this page

  • Prerequisites
    • R Setup
    • Assumptions
  • Scenario 1: Single-level IRT
  • Scenario 2: Three-level CRT
  • Scenario 3: Two-level MSIRT
  • Scenario 4: Three-level MSCRT

OSM B: R Application Demo

This demo presents four scenarios showcasing how our database of design parameters can be used in power analysis when planning randomized intervention studies on students’ SEL outcomes. We show how to determine:

  1. the minimum required sample size (MRSS) expressed as the number of students
    illustrated by the example of a single-level individually randomized trial (IRT)

  2. the minimum detectable effect size (MDES)
    illustrated by the example of a three-level cluster randomized trial (CRT)

  3. statistical power (1−β)
    illustrated by the example of a two-level multisite individually randomized trial (MSIRT)

  4. the minimum required sample size (MRSS) expressed as the number of schools
    illustrated by the example of a three-level multisite cluster randomized trial (MSCRT)

Prerequisites

R Setup

We demonstrate power analysis in R using the package PowerUpR (Bulus et al., 2021). It implements the power formulas given in Dong and Maynard (2013). Specifically, we use the functions mrss.ira() and mrss.bcra3r2() to calculate the MRSS (Scenario 1 and 4, respectively), mdes.cra3() to calculate the MDES (Scenario 2), and power.bira2() to calculate 1−β (Scenario 3) for the main treatment effect. Researchers may also use the companion PowerUpR shiny app (Ataneka et al., 2023) or the Excel tool PowerUp! (Dong et al., 2015). Note that there are several other appropriate software solutions for planning IRTs and CRTs, such as Optimal Design (Spybrook et al., 2011).

# -- Load packages
# Data wrangling and handling
library(dplyr)
library(stringr)
library(tidyr)
library(purrr)
library(tibble)
# Table processing and plotting
library(knitr)
library(ggplot2)
# Power analysis 
library(PowerUpR)
# -- Load design parameter database into global environment
urls <- list(
  # point estimates
  pe = "https://raw.githubusercontent.com/sophiestallasch/sel-designparams/main/data/dp_pe.pub.rda",
  # meta-analytic summaries
  ma = "https://raw.githubusercontent.com/sophiestallasch/sel-designparams/main/data/dp_ma.pub.rda"
)

walk(urls, ~ load(url(.x), envir = .GlobalEnv))

If you encounter any issues, download the .rda files for the point estimates and meta-analytic summaries and load it manually into R.

Assumptions

Generally, we assume a balanced design where the respective randomization units are randomly assigned to experimental conditions in equal shares (i.e., 50% of the sample in the treatment group and 50% in the control group; P = 0.50). Further, we set the desired power at 80% (1-β = 0.80) and use a two-tailed test with Type I error rate of 5% (α = 0.05) which allows for the detection of potentially unexpected negative intervention effects. Note that these assumptions correspond to the default settings in PowerUpR.

Scenario 1: Single-level IRT

A lab-based IRT on SEL outcomes across multiple contexts and domains in elementary school

How many students are required?

A research team has developed a universal intervention to promote elementary students’ SEL outcomes across multiple contexts and domains. The team plans a single-level lab-based randomized experiment to test whether the new approach is effective under controlled lab conditions across different assessment methods.

The researchers expect a treatment effect of a size typically reported for previous randomized experiments on SEL outcomes. The meta-analysis by Wilson et al. (2025, Table 2) suggests that the average standardized mean difference across social and behavioral outcomes lies in the range 0.07 ≤ SMD ≤ 0.35, with a median of Mdn(SMD) = 0.22. The team therefore considers a treatment effect of this size on students’ SEL outcomes plausible and meaningful.

The researchers thus conduct power analysis to determine the required number of students that should be sampled to ensure their IRT can achieve a minimum detectable effect size of MDES = 0.22 (with 1-β = 0.80 and α = 0.05 in a two-tailed test).

# set the MDES
es.s1 <- .22

Baseline Design without Covariates

In a first setup, the research team considers a design without covariates.

# apply PowerUpR::mrss.ira()
mrss.ira(
  es = es.s1,          # Target effect size/MDES
  power = .80,         # Power; default: 80%
  alpha = .05,         # Probability of Type I error; default: 5% 
  two.tailed = TRUE,   # Hypothesis test; default: two-tailed
  p = .50,             # Proportion of students in the treatment group; default: 50%
  n0 = 10,             # Starting value for finding the sample size; default: 10
  tol = .10,           # Tolerance of iterations for finding the sample size; default: 0.1
  g1 = 0,              # Number of covariates; default: 0
  r21 = 0              # Proportion of explained variance by covariates; default: 0
  )
n = 651 

The MRSS equals 651. Therefore, in total, N = 651 students are required to achieve MDES = 0.22 when omitting covariates. Hence, the researchers would have to randomly assign n = 326 students to the treatment group and n = 326 students to the control group.

Designs with Covariates

In a second setup, the research team would like to test the impact of different covariate sets (in terms of R2Total) on the required sample size.

Because the intervention targets SEL outcomes across multiple domains and contexts (as opposed to a specific measure), the researchers rely on the meta-analytic summaries of the design parameters. Specifically, they consult the results of MA-1 with student self-reports, parent ratings, and teacher ratings in elementary school. Note that design parameters are not available for teacher ratings in Model Sets 2-BL and 3-SD+BL.

Moreover, the team intends to take into account the statistical uncertainty associated with the estimated design parameters. For this purpose, the researchers determine conservative upper/liberal lower bounds for the MRSS by drawing on the respective lower/upper bound estimates of the 95% CIs of the meta-analytic averages of R2Total.

# select the relevant design parameters
dp.s1 <- dp_ma %>% 
  filter(Type == "MA-1", 
         Population == "Total",
         Design == "1L-D",
         Edu.level == "Elementary") %>% 
  
  # select relevant columnns
  select(Method, Set, n_Covariates, Parameter, Average, starts_with("CI"))

Table 1 shows the design parameters applied in the power analyses:

Code
# inspect selected design parameters
kable(dp.s1 %>% 
        mutate(across(c(Average:CI.ub), ~sprintf("%.2f", .))))
Table 1: Design Parameters for Scenario 1
Method Set n_Covariates Parameter Average CI.lb CI.ub
Student 2-BL 1 R2_Total 0.15 0.14 0.16
Student 3-SD+BL 6 R2_Total 0.16 0.15 0.17
Student 1-SD 5 R2_Total 0.04 0.03 0.05
Parent 2-BL 1 R2_Total 0.46 0.45 0.47
Parent 3-SD+BL 6 R2_Total 0.46 0.46 0.47
Parent 1-SD 5 R2_Total 0.05 0.00 0.10
Teacher 1-SD 5 R2_Total 0.06 0.04 0.08

Using these estimates, the research team systematically studies how the various covariate sets influence the MRSS.

# prepare database
dp.s1 <- dp.s1 %>% 
  pivot_longer(c(Average:CI.ub), 
               names_to = "statistic", values_to = "r2_total")
# custom function to vectorize PowerUpR::mrss.ira() across varying model sets
vectorize_mrss.ira <- function(g1, r21, ...) {
  parms <- list(es = es.s1, g1 = g1, r21 = r21)
  d_out <- exec(getFromNamespace("mrss.ira", ns = "PowerUpR"), !!!parms)
  d_out$n
}

# apply vectorize_mrss.ira()
d.s1 <- dp.s1 %>% 
  mutate(mrss = map2_dbl(n_Covariates, r2_total, vectorize_mrss.ira))
# clean and reshape results 
d.s1 <- d.s1 %>% 
  select(Method, Set, statistic, mrss) %>% 
  mutate(statistic = case_match(statistic,
                                "Average" ~ "MRSS",
                                "CI.lb"   ~ "MRSS conservative",
                                "CI.ub"   ~ "MRSS liberal")) %>%
  pivot_wider(names_from = statistic, values_from = mrss) %>% 
  arrange(Method, Set)

Table 2 lists the results; Figure 1 visualizes them:

Code
# show results
kable(d.s1)
Table 2: MRSS for Different Covariate Sets by Assessment Method
Method Set MRSS MRSS conservative MRSS liberal
Student 1-SD 624 633 615
Student 2-BL 553 562 545
Student 3-SD+BL 548 556 539
Parent 1-SD 621 651 588
Parent 2-BL 352 358 347
Parent 3-SD+BL 349 354 344
Teacher 1-SD 614 627 601
Code
ggplot(d.s1, aes(x = Set, y = MRSS, fill = Method)) +
  geom_hline(yintercept = d.s1.0$n, linetype = "dashed") + 
  geom_col(position = position_dodge(width = 0.8, preserve = "single"), width = 0.7) +
  geom_errorbar(
    aes(ymin = `MRSS conservative`, ymax = `MRSS liberal`),
    position = position_dodge(width = 0.8, preserve = "single"), 
    width = 0.2
    ) +
  scale_y_continuous(breaks = c(seq(0, 600, 200), d.s1.0$n), limits = c(NA, 700)) + 
  scale_fill_grey(start = 0.3, end = 0.8) +
  labs(y = "MRSS") +
  theme_minimal(base_size = 12) +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(), 
    axis.title.x = element_blank(),
    legend.title = element_blank()
  ) +
  annotate(
    "text", x = Inf, y = d.s1.0$n, label = "Baseline",
    size = 3.5, hjust = 1, vjust = -0.5
  )
Figure 1: MRSS (with conservative/liberal bounds) for Different Covariate Sets by Assessment Method

Figure 1 shows that adding covariates can substantially reduce the MRSS. As detailed in Table 2, entering the point estimates of R2Total into the power formula results in total sample size requirements of 614 ≤ N ≤ 624 when controlling for Set 1-SD, 352 ≤ N ≤ 553 when controlling for Set 2-BL, and 349 ≤ N ≤ 548 when controlling for Set 3-SD+BL, depending on the assessment method. Using the lower bound estimates of the 95% CI of R2Total, and thus, following a conservative approach, the MRSS varies between N = 354 (Parent, 3-SD+BL) and N = 651 (Parent, 1-SD). In contrast, using the respective upper bound estimates to adopt a liberal approach, the MRSS varies between N = 344 (Parent, 3-SD+BL) and N = 615 (Student, 1-SD).

To conclude, if covariates cannot be included, a total of N = 651 elementary students are necessary to achieve MDES = 0.22. However, when covariates are included in the design, the required sample size depends on the team’s risk preferences. For example, if they opted for a conservative approach by assessing both sociodemographic characteristics and a pretest, the researchers should recruit at least N = 556/354 students to adequately power their IRT to detect SMD = 0.22 based on student self-reports/parent ratings.

Scenario 2: Three-level CRT

A field three-level CRT on enjoyment of learning among Grade 4 students

Which MDES is Attainable?

The research team found that their intervention improved 4th graders’ self-reported enjoyment of learning with SMD = 0.22. The team plans a large-scale trial to evaluate whether the intervention is also effective when implemented by teachers in everyday school routine. To avoid unintentionally exposing the control group to the intervention, the researchers want to carry out a three-level cluster-randomized trial, where whole schools will be randomized to experimental conditions.

80 schools will participate in the study. From each of these schools, the team intends to sample 2 classrooms, with 20 students per classroom. Given this sample size, the researchers want to determine whether their CRT achieves MDES = 0.22 (with 1-β = .80 and α = .05 in a two-tailed test). Since the intervention targets a specific measure, the team enters the point estimates for the design parameters into their power calculations. Again, the researchers allow for the statistical uncertainty associated with the estimated design parameters. They determine conservative upper/liberal lower bound estimates for the MDES by drawing on the respective upper/lower bounds of the 95% CIs of the ICCs and the respective lower/upper bounds of the 95% CIs of the R2 values.

# set the sample size
n.s2 = 20           # Number of students per classroom
J.s2 = 2            # Number of classrooms per school
K.s2 = 80           # Number of schools
# select the relevant design parameters
dp.s2 <- dp_pe %>% 
  filter(Population == "Total",
         Design == "3L-D",
         Edu.level == "Elementary",
         Grade == 4,
         Method == "Student",
         Measure == "Enjoyment of learning") %>% 
  
  # calculate 95% CIs 
  mutate(CI.lb = Estimate - 1.96*SE,
         CI.ub = Estimate + 1.96*SE) %>% 
  
  # truncate to [0,1], if necessary
  mutate(across(starts_with("CI"), ~ pmax(0, pmin(1, .)))) %>% 
  
  # select relevant columns
  select(Set, n_Covariates, Parameter, Estimate, starts_with("CI"))

Table 3 shows the design parameters applied in the power analyses:

Code
# inspect selected design parameters
kable(dp.s2 %>% 
        mutate(across(c(Estimate, starts_with("CI")), ~sprintf("%.2f", .))))
Table 3: Design Parameters for Scenario 2
Set n_Covariates Parameter Estimate CI.lb CI.ub
0 0 ICC_Classroom 0.08 0.03 0.12
0 0 ICC_School 0.05 0.02 0.08
1-SD 5 R2_Student 0.06 0.05 0.07
1-SD 5 R2_Classroom 0.02 0.00 0.04
1-SD 5 R2_School 0.14 0.06 0.22
2-BL 1 R2_Student 0.21 0.19 0.23
2-BL 1 R2_Classroom 0.27 0.21 0.34
2-BL 1 R2_School 0.48 0.36 0.59
3-SD+BL 6 R2_Student 0.23 0.21 0.25
3-SD+BL 6 R2_Classroom 0.28 0.21 0.35
3-SD+BL 6 R2_School 0.50 0.39 0.61

Baseline Design without Covariates

Again, in a first setup, the research team considers a design without covariates.

# point estimates
mdes.cra3(
  power=.80,         # Power; default: 80%
  alpha=.05,         # Probability of Type I error; default: 5% 
  two.tailed=TRUE,   # Hypothesis test; default: two-tailed
  p=.50,             # Proportion of students in the treatment group; default: 50%
  rho2 = .08,        # Between-classroom differences (ICC_Classroom)
  rho3 = .05,        # Between-school differences (ICC_School)
  g3=0,              # Number of covariates; default: 0
  r21=0,             # Proportion of explained variance by covariates at the student level (R2_Student); default: 0
  r22=0,             # Proportion of explained variance by covariates at the classroom level (R2_Classroom); default: 0
  r23=0,             # Proportion of explained variance by covariates at the school level (R2_School); default: 0
  n = n.s2,          # Number of students per classroom
  J = J.s2,          # Number of classrooms per school
  K = K.s2           # Number of schools
  )

Minimum detectable effect size: 
--------------------------------------- 
 0.212 95% CI [0.063,0.361]
---------------------------------------
Degrees of freedom: 78
Standardized standard error: 0.075
Type I error rate: 0.05
Type II error rate: 0.2
Two-tailed test: TRUE
# ICCs: upper bound of the 95% CIs = conservative
mdes.cra3(rho2 = .12, rho3 = .08, n = n.s2, J = J.s2, K = K.s2)

Minimum detectable effect size: 
--------------------------------------- 
 0.254 95% CI [0.076,0.432]
---------------------------------------
Degrees of freedom: 78
Standardized standard error: 0.089
Type I error rate: 0.05
Type II error rate: 0.2
Two-tailed test: TRUE
# ICCs: lower bound of the 95% CIs = liberal
mdes.cra3(rho2 = .03, rho3 = .02, n = n.s2, J = J.s2, K = K.s2)

Minimum detectable effect size: 
--------------------------------------- 
 0.154 95% CI [0.046,0.262]
---------------------------------------
Degrees of freedom: 78
Standardized standard error: 0.054
Type I error rate: 0.05
Type II error rate: 0.2
Two-tailed test: TRUE

When not using covariates, the MDES equals 0.21 with the point estimates, 0.25 with the upper bound estimates of the 95% CIs, and 0.15 with the lower bound estimates of the 95% CIs of the ICCs. Consequently, with K = 80, the target effect of SMD = 0.22 is only detectable under a liberal (but potentially risky) approach to power analysis.

Designs with Covariates

The research team decides to improve design sensitivity by including strong covariates. They therefore proceed to systematically examine how different covariate sets influence the MDES.

# prepare database
dp.s2 <- dp.s2 %>% 
  pivot_longer(c(Estimate:CI.ub), 
               names_to = "statistic", values_to = "r2") %>%
  pivot_wider(names_from = Parameter, values_from = r2) %>% 

# ICC: upper bound of the 95% CI + R2: lower bound of the 95% CI = conservative
# ICC: lower bound of the 95% CI + R2: upper bound of the 95% CI = liberal
  mutate(approach = case_when(
    statistic == "Estimate" ~ "MDES",
    Set == "0" & statistic == "CI.lb" ~ "MDES liberal",
    Set == "0" & statistic == "CI.ub" ~ "MDES conservative",
    Set != "0" & statistic == "CI.lb" ~ "MDES conservative",
    Set != "0" & statistic == "CI.ub" ~ "MDES liberal"))

# extract ICCs
icc <- dp.s2 %>% 
  filter(Set == "0") %>% 
  select(approach, starts_with("ICC"))

dp.s2 <- dp.s2 %>% 
  # fill in ICCs for covariate model sets
  left_join(icc, by = "approach", suffix = c("_", "")) %>% 
  select(Set, n_Covariates, approach, starts_with("ICC"), starts_with("R2"), -ends_with("_")) %>% 
  # remove Model Set 0
  filter(Set != "0")
# custom function to vectorize PowerUpR::mdes.cra3() across varying model sets
vectorize_mdes.cra3 <- function(rho2, rho3, g3, r21, r22, r23, ...) {
  parms <- list(
    rho2 = rho2, rho3 = rho3,           
    g3 = g3, 
    r21 = r21, r22 = r22, r23 = r23,
    n = n.s2, J = J.s2, K = K.s2
  )
  d_out <- exec(getFromNamespace("mdes.cra3", ns = "PowerUpR"), !!!parms)
  d_out$mdes[1]
}

# apply vectorize_mdes.cra3()
d.s2 <- dp.s2 %>% 
  mutate(mdes = pmap_dbl(
    list(
      ICC_Classroom, ICC_School, n_Covariates, R2_Student, R2_Classroom, R2_School
      ), 
    vectorize_mdes.cra3))
# clean and reshape results
d.s2 <- d.s2 %>% 
  select(-starts_with(c("ICC", "R2"))) %>% 
  pivot_wider(names_from = approach, values_from = mdes)

Table 4 lists the results; Figure 2 visualizes them:

Code
# show results
kable(d.s2 %>% 
        mutate(across(contains("MDES"), ~sprintf("%.2f", .))))
Table 4: MDES for Different Covariate Sets
Set n_Covariates MDES MDES conservative MDES liberal
1-SD 5 0.20 0.25 0.14
2-BL 1 0.17 0.22 0.12
3-SD+BL 6 0.17 0.21 0.12
Code
ggplot(d.s2, aes(x = Set, y = `MDES`)) +
  geom_hline(yintercept = es.s1, linetype = "dashed") + 
  geom_segment(aes(xend = Set, y = 0, yend = `MDES`), color = "grey70", linewidth = 1.5) +
  geom_point(aes(y = `MDES`), size = 4, color = "black", fill = "darkgrey", shape = 21) +
  geom_errorbar(
    aes(ymin = `MDES conservative`, ymax = `MDES liberal`),
    width = 0.2
  ) +
  labs(y = "MDES") +
  theme_minimal(base_size = 13) +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),
        axis.title.x = element_blank(),
    legend.title = element_blank()
  )  +
  annotate(
    "text", x = Inf, y = es.s1, label = "Target",
    size = 3.5, hjust = 1, vjust = -0.5
  )
Figure 2: MDES (with conservative/liberal bounds) for Different Covariate Sets

Figure 2 illustrates that covariates can indeed lower the MDES. Table 4 shows that by applying the point estimates, 0.17 ≤ MDES ≤ 0.20, depending on the covariate set. Entering the upper bound estimates of the 95% CIs of the ICCs plus the lower bound estimates of the 95% CIs of the R2s under a conservative approach, the MDES varies between MDES = 0.21 and MDES = 0.25. In contrast, using the respective the lower bound estimates of the 95% CIs of the ICCs in combination with the upper bound estimates of the 95% CIs of R2s under a liberal approach, the MDES varies between MDES = 0.12 and MDES = 0.14.

In summary, with a fixed maximum of K = 80 schools in total, the research team should at least consider adding a baseline measure, hence, to pretest students’ enjoyment of learning, given statistical uncertainty. If doing so, the researchers can be confident that the sample size of their CRT will be large enough to detect SMD = 0.22 based on student self-reports.

Scenario 3: Two-level MSIRT

A field two-level MSIRT on self-esteem among Grade 13 students

Has the design adequate statistical power?

A research team aims to investigate whether an online intervention can enhance self-esteem among adolescents in Grade 13 of upper secondary school. Because students at this education level typically attend subject-specific courses with varying compositions rather than intact classrooms, the team designs a two-level MSIRT in which students are randomly assigned to experimental conditions within schools forming the sites.

To define a reasonable target effect size, the researchers consult the meta-analysis by Cipriano et al. (2023, Table 3), which reports an average standardized mean difference of SMD = 0.21 for interventions targeting SEL attitudes and beliefs. Accordingly, the team specifies a minimum detectable effect size of MDES = 0.21.

Due to financial constraints, the study needs to be designed as parsimoniously as possible with respect to sample size. The researchers plan to recruit approximately 50 students per school. In contrast, sampling schools is substantially more costly, and the total number of schools is therefore limited to a maximum of 40. To increase design sensitivity, the team decides to collect a pretest measure of self-esteem at the end of Grade 12 and include it as a covariate in the analysis.

For the power calculations, the researchers rely on the point estimates of the design parameters for self-esteem in Grade 13. Beyond these standard design parameters, power calculations for multisite experiments require additional assumptions about the degree of variation in treatment effects across sites. Accordingly, the team also has to specify values for the treatment effect heterogeneity across schools and the proportion of this between-school variance in treatment effects that can be explained by the school-level pretest. Based on Weiss et al. (2017), the standard deviation of standardized treatment effects across sites typically ranges from 0 ≤ τ ≤ .35. To assess the robustness of the study design, the research team therefore considers scenarios with small (τ² = .05²), moderate (τ² = .15²), and large (τ² = .35²) treatment effect variability across schools. Taking a conservative approach, the researchers assume that the pretest explains only a small fraction of the between-school variance in treatment effects—specifically, one tenth of the proportion of variance explained in school-level differences in self-esteem.

# set the MDES
es.s3 <- .21
# set the sample size
n.s3 <- 50             # Number of students per school
K.s3 <- seq(5, 40, 1)  # Realistically feasible range for the number of schools
# set number of covariates: 1 pretest (Set 2-BL)
ncov.s3 <- 1
# set the effect size variability: small, moderate, and large 
esv.s3 <- c(.05, .15, .35)^2
# set the factor for the proportion of variance in treatment effects explained by a pretest at the school level: 10% of R2_School 
fct_R2T.s3 <- .10
# load point estimates
load(url("https://raw.githubusercontent.com/sophiestallasch/sel-designparams/main/data/dp_pe.pub.rda"))

If you encounter any issues, click here to download the .rda file and load it manually into R.

# select the relevant design parameters
dp.s3 <- dp_pe %>% 
  filter(Population == "Total",
         Design == "2L-D",
         Edu.level == "Upper secondary",
         Grade == 13,
         Method == "Student",
         Measure == "Self-esteem", 
         Set == "0" | Set == "2-BL") %>% 
  
  # select relevant columns
  select(Set, n_Covariates, Parameter, Estimate)

Table 5 shows the design parameters applied in the power analyses:

Code
# inspect selected design parameters
kable(dp.s3 %>% 
        mutate(across(Estimate, ~sprintf("%.2f", .))))
Table 5: Design Parameters for Scenario 3
Set n_Covariates Parameter Estimate
0 0 ICC_School 0.06
2-BL 1 R2_Student 0.26
2-BL 1 R2_School 0.07

Using these estimates, the research team systematically conducts power analyses to identify the most parsimonious, while still adequately powered design under varying assumptions about τ².

# extract design parameters
dp.s3 <- dp.s3 %>% 
  select(Parameter, Estimate) %>% 
  deframe

# create tibble that combines esv3 and K
parms.s3 <- crossing(esv = esv.s3, K = K.s3)
# custom function to vectorize PowerUpR::power.bira2() across different assumptions on the effect size variability and varying sample sizes
vectorize_power.bira2 <- function(esv2, K) {
  parms <- list(
    es = es.s3,
    rho2 = dp.s3["ICC_School"],
    esv2 = esv2,                        # Effect size variability at the school level
  # omega2 = esv2/dp.s3["ICC_School"],  # Alternatively, treatment effect heterogeneity: omega2 = esv2/rho2. In this case, ´esv2´ is ignored.
    g2 = ncov.s3, 
    r21 = dp.s3["R2_Student"], 
    r2t2 = dp.s3["R2_School"] * fct_R2T.s3, # Proportion of explained treatment effect variance by covariates at the school level: 1/10 of R2_School; default: 0
    n = n.s3, 
    J = K
  )
  d_out <- exec(getFromNamespace("power.bira2", ns = "PowerUpR"), !!!parms)
  d_out$power
}

# apply vectorize_power.bira2()
d.s3 <- parms.s3 %>% 
  mutate(power = map2_dbl(esv, K, vectorize_power.bira2)) %>% 
  # categorize esv
  mutate(
  esv_label = factor(esv,
    labels = map_chr(as.numeric(levels(factor(esv))), format_esv)
    )
  )

Table 6 lists the results; Figure 3 visualizes them:

Code
# show results
d.s3 %>% 
  filter(K %in% c(5, 6, 7, 38, 39, 40)) %>%
  select(-esv) %>% 
  pivot_wider(names_from = esv_label, values_from = power) %>%
  mutate(K = as.character(K), 
         across(starts_with("τ²"), ~sprintf("%.4f", .))) %>%
  {bind_rows(., slice(., 1) %>% mutate(across(everything(), ~ "⋮")))} %>% 
  mutate(K = factor(K, levels = c("5", "6", "7", "⋮", "38", "39", "40"))) %>% 
  arrange(K) %>% 
  kable
Table 6: Power 1−β Across Varying Numbers of Schools and Effect Size Variability
K τ² = .05² τ² = .15² τ² = .35²
5 0.2780 0.2218 0.1263
6 0.3738 0.2951 0.1584
7 0.4630 0.3659 0.1905
⋮ ⋮ ⋮ ⋮
38 0.9995 0.9947 0.8492
39 0.9996 0.9956 0.8587
40 0.9997 0.9963 0.8677
Code
k80 <- d.s3 %>%
  group_by(esv_label) %>%
  filter(power >= .80) %>%
  slice_min(K, n = 1) %>%
  ungroup()

ggplot(d.s3, 
       aes(x = K, y = power, color = esv_label)) +
  geom_hline(yintercept = .80, linetype = "dashed") + 
  geom_line(linewidth = 1) +
  geom_segment(data = k80, 
               aes(x = K, xend = K, y = -.025, yend = power, color = esv_label),
               linewidth = 0.75, linetype = "dashed") +
  geom_text(data = k80,
            aes(x = K, y = -.025, label = K),
            color = "#111111", vjust = 1.2, size = 3) +
  scale_y_continuous(breaks = seq(0, 1, .20), limits = c(-.025, 1)) +
  scale_color_grey(start = 0.3, end = 0.8) +
  labs(y = "Power 1−β") +
  theme_minimal(base_size = 12) +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),
    axis.title.x = element_blank(),
    legend.title = element_blank()
  ) +
  annotate(
    "text", x = Inf, y = .80, label = "Target",
    size = 3.5, hjust = 1, vjust = -0.5
  )
Figure 3: Power Curves Across Varying Numbers of Schools and Effect Size Variability

As shown in Table 6, statistical power varies between 0.28 ≤ 1-β ≤ 1.00 when assuming τ² = .05², between 0.22 ≤ 1-β ≤ 1.00 when assuming τ² = .15², and between 0.13 ≤ 1-β ≤ 0.87 when assuming τ² = .35².

Figure 3 reveals that statistical power increases monotonically with the number of sampled schools across all assumptions about effect size variability. Under the small effect size variability assumption (τ² = .05²), the target power of 80% is achieved with K = 13 schools. Assuming moderate effect size variability (τ² = .15²), at least K = 17 schools are required to reach adequate power. Even under the most conservative assumption of large effect size variability (τ² = .35²), the 80% power threshold is exceeded with K = 34 schools.

Overall, the research team learns that the maximally feasible sample size of K = 40 schools is sufficient to ensure adequate statistical power even under pessimistic assumptions regarding treatment effect heterogeneity.

Scenario 4: Three-level MSCRT

A field three-level MSCRT on peer relationships in non-academic lower secondary schools

How many schools are required?

A research team is commissioned by policymakers to evaluate the effectiveness of a newly developed program aimed at strengthening peer relationships among students in Grades 5 to 10 attending the non-academic track of lower secondary education. Because the intervention targets classroom-level peer processes, the team plans a three-level MSCRT randomizing intact classrooms within schools.

The policymakers indicate that they would support a regular implementation of the program only if its effects are at least comparable to those typically achieved by existing similar interventions. Accordingly, the research team defines a minimum relevant effect size of MRES = 0.22, corresponding to the average standardized mean difference reported for interventions targeting peer relationships in the meta-analysis by Cipriano et al. (2023, Table 3).

In line with common organizational structures in lower secondary schools, the team plans to sample at least 4 classrooms per school, with 20 students per classroom. The students will be post-tested after completion of the program. To improve statistical precision, the analyses will adjust for students’ sociodemographic characteristics.

To inform the power analyses, the researchers draw on the meta-analytically summarized design parameters for other-oriented SEL domains in a general context from MA-3. To explicitly account for uncertainty in these design parameters, they additionally incorporate the 95% CIs and 95% PIs into their calculations. Specifically, they consider a pessimistic planning scenario by combining the respective upper bounds for ICCs with the lower bounds of the R2 values. Moreover, the team assumes a moderate degree of cross-school treatment effect heterogeneity, setting the effect size variability to τ² = 0.15² (Weiss et al., 2017). Further, they assume that school-level sociodemographics can explain a substantial share of this heterogeneity (see Schochet et al., 2014; Weiss et al., 2014), amounting to approximately half of the variance in between-school differences in other-oriented general-context outcome measures accounted for by these covariates.

In applied school settings, perfectly balanced treatment allocation at the classroom level is often difficult to achieve. Practical constraints, differential opportunities for program implementation, and ethical considerations may result in unequal proportions of classrooms assigned to the treatment and control conditions. To reflect this realistic planning uncertainty, the research team conducts sensitivity analyses across varying treatment allocation proportions in the range of 0.50 ≤ P ≤ 0.90. The goal of these power analyses is to determine the minimum required number of schools needed to ensure sufficient statistical power (1-β = 0.80) to detect the policy-relevant MRES of 0.22 (with α = 0.05 in a two-tailed test), even under substantial treatment allocation imbalance.

# set the MRES
es.s4 <- .22
# set the sample size
n.s4 <- 20           # Number of students per classroom
J.s4 <- 4            # Number of classrooms per school
# set the effect size variability 
esv.s4 <- .15^2      # moderate esv
# set the factor for the proportion of variance in treatment effects explained by sociodemographics at the school level: 50% of R2_School 
fct_R2T.s4 <- .50
# set the range of allocation proportions 
P.s4 <- seq(.50, .90, .01) # balanced design: P = 50%; unbalanced designs: P > 50% (treatment or control group overrepresented)
# Note that in this two-arm design, allocation proportions P and 1-P yield identical results due to the (assumed) symmetry of the treatment and control group 
# select the relevant design parameters
dp.s4 <- dp_ma %>% 
  filter(Type == "MA-3", 
         Population == "Non-academic",
         Design == "3L-D",
         Edu.level == "Lower secondary", 
         Method == "Student", 
         Domain == "Other", 
         Context == "General", 
         Set == "0" | Set == "1-SD") %>% 
  
  # select relevant columnns
  select(Set, n_Covariates, Parameter, Average, starts_with(c("CI", "PI"))) %>% 
  # keep upper bounds of the 95% CI/PI for ICCs + lower bounds of the 95% CI/PI for R2 = most pessimistic case
  mutate(across(contains("ub"), ~ if_else(grepl("^ICC_", Parameter), ., NA_real_)),
         across(contains("lb"), ~ if_else(grepl("^R2_", Parameter), ., NA_real_))) %>% 
  arrange(Set)

Table 7 shows the design parameters applied in the power analyses:

Code
# inspect selected design parameters
kable(dp.s4 %>% 
        mutate(across(where(is.double), ~ if_else(is.na(.), "", sprintf("%.2f", .)))))
Table 7: Design Parameters for Scenario 4
Set n_Covariates Parameter Average CI.lb CI.ub PI.lb PI.ub
0 0 ICC_Classroom 0.01 0.03 0.04
0 0 ICC_School 0.00 0.01 0.01
1-SD 5 R2_Student 0.02 0.00 0.00
1-SD 5 R2_Classroom 0.07 0.00 0.00
1-SD 5 R2_School 0.32 0.14 0.00

Entering these estimates, the research team conducts a series of power analyses to determine the MRSS and to test how sensitive their design reacts towards potential treatment allocation imbalance.

# prepare database
dp.s4 <- dp.s4 %>% 
  pivot_longer(c(Average:PI.ub), names_to = "statistic", values_drop_na = TRUE) %>%
  pivot_wider(names_from = Parameter, values_from = value) %>% 
  
  # clean `statistic`
  mutate(statistic = str_replace(statistic, "^(CI|PI)\\..*", "95% \\1 (conservative)")) %>% 
  
  # fill in ICCs for covariate model sets
  fill(ICC_Classroom, ICC_School, .by = statistic, .direction = "down") %>% 
  # remove Model Set 0
  filter(Set != "0") %>% 

  # select relevant columns
  select(-Set) 

# add range of allocation proportions
dp.s4 <- dp.s4 %>% 
  crossing(P.s4)
# custom function to vectorize PowerUpR::mrss.bcra3r2() across varying treatment allocation proportions
vectorize_mrss.bcra3r2 <- function(rho2, rho3, P, g3, r21, r22, r23,...) {
  parms <- list(
    es = es.s4,
    rho2 = rho2, 
    rho3 = rho3,
    esv3 = esv.s4,
    p = P,
    g3 = g3,
    r21 = r21, 
    r22 = r22, 
    r2t3 = r23 * fct_R2T.s4,
    n = n.s4, 
    J = J.s4
  )
  d_out <- exec(getFromNamespace("mrss.bcra3r2", ns = "PowerUpR"), !!!parms)
  d_out$K
}

# apply vectorize_mrss.bcra3r2()
d.s4 <- dp.s4 %>% 
  mutate(mrss = pmap_dbl(
    list(
      ICC_Classroom, ICC_School, P.s4, n_Covariates, R2_Student, R2_Classroom, R2_School
      ), 
    vectorize_mrss.bcra3r2))
# clean and reshape results
d.s4 <- d.s4 %>% 
  select(-starts_with(c("n_", "ICC", "R2"))) %>% 
  pivot_wider(names_from = statistic, values_from = mrss) %>% 
  select(P = P.s4, Average, starts_with("95%"))

Table 8 lists the results; Figure 4 visualizes them:

Code
# show results
d.s4[seq(1, nrow(d.s4), 10), ] %>% 
  kable
Table 8: MRSS for Average and Conservative Design Parameters by Treatment Allocation Proportion
P Average 95% CI (conservative) 95% PI (conservative)
0.5 16 19 21
0.6 16 20 21
0.7 18 22 23
0.8 21 26 28
0.9 33 42 45
Code
d.s4 %>% 
ggplot(aes(x = P.s4)) +
  geom_ribbon(aes(ymin = Average, ymax = `95% CI (conservative)`, fill = "95% CI"), alpha = 0.5) + 
  geom_ribbon(aes(ymin = Average, ymax = `95% PI (conservative)`, fill = "95% PI"), alpha = 0.5) + 
  geom_line(aes(y = Average, color = "Average"), linewidth = 0.5) + 
  geom_point(aes(y = Average, color = "Average")) +
  
  scale_y_continuous(breaks = seq(15, 45, 10), limits = c(15, 45)) +
  scale_color_manual(values = c("Average" = "#4D4D4D")) +
  scale_fill_manual(values = c("95% CI" = "#9C9C9C", "95% PI" = "#CCCCCC"),
                    breaks = c("95% PI", "95% CI")) +
  guides(fill = guide_legend(order = 1), color = guide_legend(order = 2)) +
  labs(y = "MRSS") +
  theme_minimal(base_size = 12) +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),
    axis.title.x = element_blank(),
    legend.title = element_blank(), 
    legend.spacing.y = unit(-0.2, "cm")
  )
Figure 4: MRSS (with 95% CI and PI) for Varying Treatment Allocation Proportions

As shown in Table 8, across allocation proportions, the MRSS ranges between 16 ≤ K ≤ 33 schools when using the meta-analytic average design parameters, between 19 ≤ K ≤ 42 schools when relying on conservative 95% CI bounds, and between 21 ≤ K ≤ 45 schools when adopting the most pessimistic assumptions based on 95% PI bounds. Under mild imbalance (P = .60), the required number of schools still equals K = 16 when using the meta-analytic averages. This requirement increases to K = 20 schools when using 95% CI bounds and to K = 21 schools when relying on 95% PI bounds. Under strong imbalance (P = .80), the MRSS correspondingly rises to K = 21/26/28 schools.

Figure 4 illustrates that the MRSS increases monotonically with growing treatment allocation imbalance in all considered cases. As the allocation proportion departs from a balanced design, increasingly more schools are required to compensate for the resulting loss in statistical efficiency. This increase is substantial when relying on the meta-analytic averages, and becomes even more pronounced under conservative 95% CI- and 95% PI-based assumptions.

To sum up, the results indicate that treatment allocation imbalance can considerably inflate the MRSS in the three-level MSCRT on peer relationships. Planning under realistic degrees of uncertainty therefore necessitates a noticeably larger school sample to ensure that the design is sensitive enough to detect MRES = .22, particularly when strong imbalance is anticipated.

References

Ataneka, A., Kelcey, B., Dong, N., Bulus, M., & Bai, F. (2023). PowerUpR Shiny App 0.9 manual. https://www.causalevaluation.org/uploads/7/3/3/6/73366257/r_shinnyapp_manual_0.9.pdf
Bulus, M., Dong, N., Kelcey, B., & Spybrook, J. (2021). PowerUpR: Power analysis tools for multilevel randomized experiments. R package version 1.1.0. https://CRAN.R-project.org/package=PowerUpR
Cipriano, C., Strambler, M. J., Naples, L. H., Ha, C., Kirk, M., Wood, M., Sehgal, K., Zieher, A. K., Eveleigh, A., McCarthy, M., Funaro, M., Ponnock, A., Chow, J. C., & Durlak, J. (2023). The state of evidence for social and emotional learning: A contemporary meta-analysis of universal school-based SEL interventions. Child Development, 94(5), 1181–1204. https://doi.org/10.1111/cdev.13968
Dong, N., Kelcey, B., Maynard, R., & Spybrook, J. (2015). PowerUp! Tool for power analysis. www.causalevaluation.org
Dong, N., & Maynard, R. (2013). PowerUp!: A tool for calculating minimum detectable effect sizes and minimum required sample sizes for experimental and quasi-experimental design studies. Journal of Research on Educational Effectiveness, 6(1), 24–67. https://doi.org/10.1080/19345747.2012.673143
Schochet, P. Z., Puma, M., & Deke, J. (2014). Understanding variation in treatment effects in education impact evaluations: An overview of quantitative methods. Institute of Education Sciences (IES). https://ies.ed.gov/ncee/pubs/20144017/pdf/20144017.pdf
Spybrook, J., Bloom, H., Congdon, R., Hill, C., Martinez, A., & Raudenbush, S. (2011). Optimal design plus empirical evidence: Documentation for the "Optimal Design" software. https://wtgrantfoundation.org/wp-content/uploads/2015/11/OD-Documentation-V3.pdf
Weiss, M. J., Bloom, H. S., & Brock, T. (2014). A conceptual framework for studying the sources of variation in program effects. Journal of Policy Analysis and Management, 33(3), 778–808. https://doi.org/10.1002/pam.21760
Weiss, M. J., Bloom, H. S., Verbitsky-Savitz, N., Gupta, H., Vigil, A. E., & Cullinan, D. N. (2017). How much do the effects of education and training programs vary across sites? Evidence from past multisite randomized trials. Journal of Research on Educational Effectiveness, 10(4), 843–876. https://doi.org/10.1080/19345747.2017.1300719
Wilson, S. J., Freeman, B., & Hedberg, E. C. (2025). Empirical benchmarks for effect size interpretation and study planning with social and behavioral outcomes. Journal of Research on Educational Effectiveness, 1–26. https://doi.org/10.1080/19345747.2024.2427767

© 2025 The authors