function generateSubset_ConversationStatements(dataset) {
let subset = {
counts: [
{name: "EU", outcome: {splits: 0, steals: 0}},
{name: "IU Character", outcome: {splits: 0, steals: 0}},
{name: "IU Past Intent", outcome: {splits: 0, steals: 0}},
{name: "IU Preference", outcome: {splits: 0, steals: 0}},
{name: "IU Money", outcome: {splits: 0, steals: 0}},
{name: "IU Viewers", outcome: {splits: 0, steals: 0}},
{name: "IU Plea for Trust", outcome: {splits: 0, steals: 0}},
{name: "EC", outcome: {splits: 0, steals: 0}},
{name: "IC", outcome: {splits: 0, steals: 0}},
{name: "None Said", outcome: {splits: 0, steals: 0}},
],
percentages: [
{name: "EU", value: 0},
{name: "IU Character", value: 0},
{name: "IU Past Intent", value: 0},
{name: "IU Preference", value: 0},
{name: "IU Money", value: 0},
{name: "IU Viewers", value: 0},
{name: "IU Plea for Trust", value: 0},
{name: "EC", value: 0},
{name: "IC", value: 0},
{name: "None Said", value: 0},
],
};
for(let i = 0; i < dataset.length; i++) {
let choice = dataset[i].splitOrSteal == 'Split' ? 'splits' : 'steals';
// If a contestant makes a type of statement at LEAST once, add them to the respective category
// Player explicitly states they would unconditionally split or never steal
if(dataset[i].EUStatements > 0)
subset.counts[0].outcome[choice]++;
// Player implies they would never steal since it goes against their own character
if(dataset[i].IUCharacterStatements > 0)
subset.counts[1].outcome[choice]++;
// Player implies they had a past intention to unconditionally split or avoid stealing
if(dataset[i].IUPastIntentionStatements > 0)
subset.counts[2].outcome[choice]++;
// Player implies they have a personal preference for unconditionally choosing split
if(dataset[i].IUPreferenceStatements > 0)
subset.counts[3].outcome[choice]++;
// Player implies they will unconditionally split since they are satisfied with half the jackpot
if(dataset[i].IUMoneyStatements > 0)
subset.counts[4].outcome[choice]++;
// Player implies they would unconditionally split due to judgement of the audience, viewers, friends, family, etc.
if(dataset[i].IUViewers > 0)
subset.counts[5].outcome[choice]++;
// Player implies they could be trusted to unconditionally split
if(dataset[i].IUPleaForTrust > 0)
subset.counts[6].outcome[choice]++;
// Player explicitly states they would split only on a given condition
if(dataset[i].ECStatements > 0)
subset.counts[7].outcome[choice]++;
// Player implicitly states they would split only on a given condition
if(dataset[i].ICStatements > 0)
subset.counts[8].outcome[choice]++;
// Player made no explicit or implicit statement that they would split/would not steal
if(dataset[i].EUStatements == 0 && dataset[i].IUStatements == 0)
subset.counts[9].outcome[choice]++;
}
// Process the counts into percentages
for(let i = 0; i < subset.counts.length; i++) {
let totalOutcomes = (subset.counts[i].outcome.splits + subset.counts[i].outcome.steals);
subset.percentages[i].value = subset.counts[i].outcome.splits / totalOutcomes;
}
// Return the data structure
return subset;
}