Stratified Randomized Experiments
Overview
Estimate average treatment effects (ATEs) in stratified randomized experiments. 'sreg' supports a wide range of stratification designs, including matched pairs, n-tuple designs, and larger strata with many units — possibly of unequal size across strata. 'sreg' is designed to accommodate scenarios with multiple treatments and cluster-level treatment assignments, and accommodates optimal linear covariate adjustment based on baseline observable characteristics. 'sreg' computes estimators and standard errors based on Bugni, Canay, Shaikh (2018) doi:10.1080/01621459.2017.1375934; Bugni, Canay, Shaikh, Tabord-Meehan (2024+) doi:10.48550/arXiv.2204.08356; Jiang, Linton, Tang, Zhang (2023+) doi:10.48550/arXiv.2201.13004; Bai, Jiang, Romano, Shaikh, and Zhang (2024) doi:10.1016/j.jeconom.2024.105740; Bai (2022) doi:10.1257/aer.20201856; Bai, Romano, and Shaikh (2022) doi:10.1080/01621459.2021.1883437; Liu (2024+) doi:10.48550/arXiv.2301.09016; and Cytrynbaum (2024) doi:10.3982/QE2475.
Estimation and inference
- Corrected the large-strata variance estimator for experiments with multiple active treatment arms under both individual- and cluster-level assignment. The estimator now includes the contribution of clusters or individuals assigned to active arms other than the arm being compared with control.
- Corrected the small-strata cluster estimator. Point estimation now uses expanded cluster outcomes, cluster-level covariate means, and normalization by the mean represented cluster size. The corresponding variance estimator now incorporates the common random denominator and the contributions of all treatment arms.
- Corrected mixed-design inference under cluster-level assignment. Component estimates are now weighted by their shares of the represented individual population, computed from
Ng, and the variance estimator includes the variability of these random population shares.
Show all changes in 2.1.0Hide the rest of the changes in 2.1.0
- Covariates supplied for a mixed design are now used in both its small- and large-strata components for individual- and cluster-level assignment. A targeted error explains when the large-strata component cannot identify the requested treatment-by-stratum adjustment and recommends reducing the covariate set or using
X = NULL. - Improved HC1 handling in degenerate multi-treatment settings by reverting to the unadjusted variance estimate when the finite-sample correction is undefined.
Design support and interface
- Added the optional
kargument tosreg(). It validates the common stratum size in uniform small-strata designs and identifies the small-stratum size in general mixed designs, extending mixed-design support beyond matched pairs and triplets to general k-tuples. - Improved automatic design classification, validation messages, and warnings for small- and mixed-strata designs under both individual- and cluster-level assignment.
- Standardized user-facing output to use the term "large strata" rather than "big strata."
Data generation
- Extended
sreg.rgen()to generate mixed designs through the newmixed.strataandn.smallarguments for both individual- and cluster-level assignment. - Added optional stratum-specific allocation probabilities, stratum effects, and treatment effects through
allocation.probs,stratum.effects, andtreatment.effects.by.stratumfor large-strata individual-level designs. - Clarified that
ncounts clusters whencluster = TRUE, strengthened input validation, and corrected large-strata cluster generation so thatis.cov = FALSEno longer returns covariate columns.
Documentation and maintenance
- Substantially expanded the function documentation, examples, README, and introductory vignette to cover large-, small-, mixed-, and cluster-randomized designs and the S3 print and plot methods.
- Corrected references and documented the structure of returned objects, cluster-size handling, cluster-level covariate aggregation, and mixed-design adjustment behavior.
- Expanded the automated test suite for multi-arm variance estimation, general k-tuple and mixed designs, cluster estimators, data generation, design classification, and adjustment diagnostics.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 5
- Examples that run
- 100%5 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 40%
Downloads
Repository
- PRs merged (all time)
- 33%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
Commits over time
6 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/jutrifonov/sreg on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2024-06-25
- Total releases
- 5 / 2 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 2.10
- Bundled data
- 13 KB / 1 file
- Download size
- 154 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("sreg")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.