Dear Stata users,
we are pleased to announce BBANDITS:
A new user-written Stata package for implementing and analyzing adaptive (and classic) experiments also known as randomized controlled trials (RCTs).
BBANDITS allows earning while learning
- Design and run own experiments using bbandits without wasting ressources on inferior treatment arms
- Choose optimally how to allocate treatment groups using treatment assignment algorithms such as ε-first, ε-greedy, and Thompson sampling
- Analyse treatment effects with correct causal inference
- Visualize your results
Install BBANDITS
The RePEc entry (Thank you, Kit Baum!) is here:
https://ideas.repec.org/c/boc/bocode/s459627.html
Check also the bbandits website.
Impressions (see help file for more info)
Six call methods to enroll rice farmers (Kasy and Sautmann 2021)
Invitation Messages for Business Surveys: A Multi-Armed Bandit Experiments (Gaul et al. 2025)
Simulating a stacked 3-armed adaptive experiment for treatment assignment in Stata using bbandits
There is a push for adaptive experiments across disciplines
Adaptive experiments are increasingly used because they allow researchers and practitioners to “earn while learning”: treatment assignment can be updated as evidence accumulates.
Applications include
- medicine,
- pharmacology,
- economics,
- development and public policy,
- political science,
- survey research,
- etc.
Examples include:
Athey, S., and G. W. Imbens. 2019. “Machine Learning Methods That Economists Should Know About.” Annual Review of Economics 11: 685–725.
Avivi, H., P. Kline, E. Rose, and C. Walters. 2021. “Adaptive Correspondence Experiments.” AEA Papers and Proceedings 111: 43–48.
Caria, A. S., G. Gordon, M. Kasy, S. Quinn, S. O. Shami, and A. Teytelboym. 2023. “An Adaptive Targeted Field Experiment: Job Search Assistance for Refugees in Jordan.” Journal of the European Economic Association 22: 781–836.
Gaul, J. J., F. Keusch, D. Rostam-Afschar, and T. Simon. 2025. “Invitation Messages for Business Surveys: A Multi-Armed Bandit Experiment.” Survey Research Methods 19(4): 409–429.
Kasy, M., and A. Sautmann. 2021. “Adaptive Treatment Assignment in Experiments for Policy Choice.” Econometrica 89: 113–132.
Offer-Westort, M., A. Coppock, and D. P. Green. 2021. “Adaptive Experimental Design: Prospects and Applications in Political Science.” American Journal of Political Science 65: 826–844.
Adaptive experimentation is also widely used by practitioners, e.g., at Microsoft Research, Google, Netflix, Yahoo! Research, and LinkedIn.
We welcome comments, bug reports, and suggestions.
Best wishes,
Davud Rostam-Afschar
Jan Kemper
we are pleased to announce BBANDITS:
A new user-written Stata package for implementing and analyzing adaptive (and classic) experiments also known as randomized controlled trials (RCTs).
BBANDITS allows earning while learning
- Design and run own experiments using bbandits without wasting ressources on inferior treatment arms
- Choose optimally how to allocate treatment groups using treatment assignment algorithms such as ε-first, ε-greedy, and Thompson sampling
- Analyse treatment effects with correct causal inference
- Visualize your results
Install BBANDITS
Code:
ssc install bbandits help bbandits
https://ideas.repec.org/c/boc/bocode/s459627.html
Check also the bbandits website.
Impressions (see help file for more info)
Six call methods to enroll rice farmers (Kasy and Sautmann 2021)
Invitation Messages for Business Surveys: A Multi-Armed Bandit Experiments (Gaul et al. 2025)
Simulating a stacked 3-armed adaptive experiment for treatment assignment in Stata using bbandits
There is a push for adaptive experiments across disciplines
Adaptive experiments are increasingly used because they allow researchers and practitioners to “earn while learning”: treatment assignment can be updated as evidence accumulates.
Applications include
- medicine,
- pharmacology,
- economics,
- development and public policy,
- political science,
- survey research,
- etc.
Examples include:
Athey, S., and G. W. Imbens. 2019. “Machine Learning Methods That Economists Should Know About.” Annual Review of Economics 11: 685–725.
Avivi, H., P. Kline, E. Rose, and C. Walters. 2021. “Adaptive Correspondence Experiments.” AEA Papers and Proceedings 111: 43–48.
Caria, A. S., G. Gordon, M. Kasy, S. Quinn, S. O. Shami, and A. Teytelboym. 2023. “An Adaptive Targeted Field Experiment: Job Search Assistance for Refugees in Jordan.” Journal of the European Economic Association 22: 781–836.
Gaul, J. J., F. Keusch, D. Rostam-Afschar, and T. Simon. 2025. “Invitation Messages for Business Surveys: A Multi-Armed Bandit Experiment.” Survey Research Methods 19(4): 409–429.
Kasy, M., and A. Sautmann. 2021. “Adaptive Treatment Assignment in Experiments for Policy Choice.” Econometrica 89: 113–132.
Offer-Westort, M., A. Coppock, and D. P. Green. 2021. “Adaptive Experimental Design: Prospects and Applications in Political Science.” American Journal of Political Science 65: 826–844.
Adaptive experimentation is also widely used by practitioners, e.g., at Microsoft Research, Google, Netflix, Yahoo! Research, and LinkedIn.
We welcome comments, bug reports, and suggestions.
Best wishes,
Davud Rostam-Afschar
Jan Kemper
