clustered_experiment: Simulated cluster-randomized experiment

clustered_experimentR Documentation

Simulated cluster-randomized experiment

Description

Thirty classes of varying size are assigned to treatment or control as whole clusters, so every student in a class shares its assignment. Outcomes are driven by a class-level shock as well as a student-level one, which is why uncertainty estimates that ignore the clustering are overconfident.

Usage

clustered_experiment

Format

clustered_experiment

A tibble with 441 rows and 11 columns:

class

Cluster identifier, 30 classes in all

n_per_class

Number of students in the class, between 10 and 20

class_shock

Class-level component of the outcome

student

Student identifier within class

student_shock

Student-level component of the outcome

Y_Z_0, Y_Z_1

Continuous potential outcomes under control and treatment

Z

Random assignment, constant within class

Z_cond_prob

Probability of the assigned condition, 0.5 throughout

Y

Revealed outcome

condition

Z labelled "Treatment" and "Control"

Source

\Sexpr[results=rd]{tools:::Rd_expr_doi("10.7910/DVN/VE6VSR")}

See Also

Other Data: attrition_experiment, blocked_experiment, continuous_interaction, covariate_adjustment, noncompliance_experiment, patriot_act, two_arm_trial


vayr documentation built on Aug. 22, 2026, 1:08 a.m.