SweetPea: A standard language for factorial experimental design.
Sebastian MusslickAnastasia CherkaevBen DrautAhsan Sajjad ButtPierce DarraghVivek SrikumarMatthew FlattJonathan D CohenPublished in: Behavior research methods (2021)
Experimental design is a key ingredient of reproducible empirical research. Yet, given the increasing complexity of experimental designs, researchers often struggle to implement ones that allow them to measure their variables of interest without confounds. SweetPea ( https://sweetpea-org.github.io/ ) is an open-source declarative language in Python, in which researchers can describe their desired experiment as a set of factors and constraints. The language leverages advances in areas of computer science to sample experiment sequences in an unbiased way. In this article, we provide an overview of SweetPea's capabilities, and demonstrate its application to the design of psychological experiments. Finally, we discuss current limitations of SweetPea, as well as potential applications to other domains of empirical research, such as neuroscience and machine learning.