##################################################################
#    Consensus formation and change are enhanced by neutrality   #
#       A. Sontag, J. Hoffmann, T. Rogers, and C.A. Yates        #
##################################################################

This folder contains data from the voting experiments designed and collected by the authors. It also contains the code used in the analysis of the data.

The experiment was coded using the oTree package for Python. Experiments were performed online with participants pooled from Prolific. The data has been anonymised to avoid any potential identification.

The Consent page and Participant Information Sheet are available in this folder. Please refer to the manuscript and Supplementary Information for details on experimental design, methodology and protocols.

Data is freely available for use in academic research as long as correctly credited. Please cite our publication if our data is used in your research.

############## FOLDER ORGANISATION ###############
There are three folders:

"With Abstentions" corresponds to the data collected from the experiments with the option to abstain (our main hypothesis).
"No Abstentions" corresponds to the data collected from experiments without the option to abstain (for comparison).
"Empirical dist" corresponds to the data collected initially to determine optimal parameters for the experiments with abstentions.

Code files in this folder are explained below and within each code as inline comments.
Additional README files are provided within each folder as necessary to provide further details on the data and code.

######## DATA ORGANISATION AND FORMATTING #########
The data from each experiment is available as .csv files with the naming convention "[group size]_[experiment number with that group size].csv" (e.g., 19_2.csv is the second experiment with 19 participants).

In each .csv file, the data of each participant corresponds to a line of the table. X votes and Y votes are also denoted A and B, respectively, or numerically as 0 and 1. Abstentions are denoted numerically as 2. The data contains the details of the number of wins of each participant, their rank, if they dropped out, the order of the decision options they were shown in the screen (e.g., [2 1 0] means that the participant saw the Abstention option on the left, voting B in the middle and voting A on the right in the first round), the colours of the voting options and the abstention option and the ID within the group (an index from 1 to the size of the group). This information does not allow for identification of any participants.

The data for each round is presented in subsequent columns of the file. The headers follow the pattern "[type of round (training or experiment)].[round number].[player or group].[property]".

"Type of round" is either a training round (denoted "training_app") or a experiment round (denoted "my_voting" for experiments with abstentions, "no_abs" for experiments without abstentions).

The properties for "player" are participant dependent. They can be the participant's vote in the round ("0" indicates voting A, "1" indicates voting B and "2" indicates abstaining), how much they spent in the round, how much they earned in the round, the sample shown in the round. Properties of the "group" are the same for all participants in the group and are the total number of A, B and Abstain votes in the round, and the winning party (A, B or None - if there was a tie).

Examples: 
+ training_app.2.player.election_vote is a column containing the election votes of all participants (one per row) in the second round of the training.
+ my_voting.115.player.sample_avotes is the column containing the number of A votes in the sample shown for each participant (different for each participant / row) in the 115th round of the experiment.

################### CODE FILES ####################
The code was placed in the folder such that the required folder navigations are defined in terms of the root folder where the code is located.
Python files have been implemented on version 3.9.16. Installation of additional requisite packages as indicated at the start of the file may be required.
C++ code requires gcc version 13.1.0 or later to compile.
MATLAB code was been implemented on version R2022a. Additional packages such as the optimisation toolbox might be required.

Each code script comes with inline comments to provide context and explain what task the code is performing. Here is a brief description of each script.

model_phase_portraits.py plots Figure S1 of the Supplementary Information depicting different behaviours of our general model.

phase_plot.py plots Figure S2 of the Supplementary Information, showing the phase diagram separating regions of mono and bistability of the parameter space and placing the voting experiments in the corresponding region.