Script from: The marginal majority effect: when social influence produces lock-in
Abstract
People are influenced by the choices of others, a phenomenon observed across contexts in the social and behavioral sciences. Social influence can lock in an initial popularity advantage of an option over a higher quality alternative. Yet, several experiments designed to enable social influence have found that social systems self-correct rather than lock in. Here, we identify a behavioral phenomenon that makes inferior lock-in possible, which we call the 'marginal majority effect': A discontinuous increase in the choice probability of an option as its popularity exceeds that of a competing option. We demonstrate the existence of a marginal majority effect in several recent experiments and show that lock-in always occurs when the effect is large enough to offset the quality effect on choice, but rarely otherwise. Our results reconcile conflicting past empirical evidence and connect a behavioral phenomenon to the possibility of social lock-in.
Dataset DOI: 10.5061/dryad.dr7sqvb8q
Description of the data and file structure
File: main.py
Description: This is the code used to generate figures 4 and 6-9 in the paper "The marginal majority effect: when social influence produces lock-in", as well as supplementary figures S2-S13. It also performs the statistical analyses reported in both the main paper an the supplementary material. It has been tested in Python 3.13 with the following package versions:
matplotlib 3.10.7
pandas 2.3.3
scipy 1.16.2
seaborn 0.13.2
statsmodels 0.14.5
How to run the code
To reproduce the figures and statistical analyses, first download the data from the experiments analyzed:
- V2019: https://doi.org/10.17605/osf.io/p4y37, specifically the file vanderijt2019.csv
- MDRT2019: https://doi.org/10.5281/zenodo.17455649, specifically the file experiment_analysis_1/answer_data.csv (original repository https://github.com/AlexMRuch/PartyLab, accessed November 3rd 2025)
- FV2021: https://doi.org/10.17605/osf.io/5f2cm, specifically the file Frey_vdRijt_WoC/data/WoC_web.dta
Save the above files in the same folder as the main.py script and run the script. The output will be saved in the same folder.
If you are interested only in certain parts of the analysis/figures, comment out any lines near the end of the script that are not needed (the output name in each line corresponds to the figure/statistical analysis that line performs).
NOTE: The statistical analyses for sections 5.2-5.4 of the supplementary material that are performed at the end are somewhat slow, in the order of minutes on a personal computer. To speed them up, adjust the num_reps parameter.
