1 Getting started

To copy the code, click the button in the upper right corner of the code-chunks.

1.1 clean up

rm(list = ls())
gc()


1.2 custom functions

We defined a number custom functions, at Download custom_functions.R.

source("./custom_functions.R")


1.3 necessary packages

  • tidyverse: data wrangling
  • igraph: generate and visualize graphs
  • parallel: parallel computing to speed up simulation
  • foreach: looping in parallel
  • doParallel: parallel backend for foreach
  • ggplot2: data visualization
  • ggh4x: hacks for ggplot2
  • ggpubr: make visualizations publication-ready
packages = c("tidyverse", "igraph", "ggplot2", "parallel", "doParallel", "foreach", "ggh4x", "ggpubr",
    "plotly", "RColorBrewer", "grid", "gridExtra", "patchwork", "ggplotify", "ggraph", "gganimate", "RColorBrewer",
    "ggtext", "magick", "jsonlite", "lubridate", "ggtext")

invisible(fpackage.check(packages))
rm(packages)

2 import data

data <- read.csv("./rawdata/all_apps_wide_2026-03-20.csv")
times <- read.csv("./rawdata/PageTimes-2026-03-20.csv")

# cbind(data$participant.node,data$participant.role)[complete.cases(
# #cbind(data$participant.node,data$participant.role)),]

bonus <- data[, c("participant.bonus", "participant.label")]
bonus <- bonus[!is.na(bonus$participant.bonus), ]
bonus_out <- data.frame(id = bonus$participant.label, bonus = bonus$participant.bonus)
# nrow(bonus_out)
write.table(bonus_out, "bonus.txt", sep = ",", row.names = FALSE, col.names = TRUE, quote = FALSE)

3 results

On 20-03-2026, I recruited 63 Prolific participants via a brief sign-up survey to populate a network of N=50 (with a 10% minority group).

The experiment was updated with a more flexible time-out mechanism (after timing out, players can return, see here).

net <- jsonlite::fromJSON("./networks/network_test_n50.json")

g <- graph_from_adjacency_matrix(net$adj_matrix, mode = "undirected")
V(g)$role <- ifelse(net$role_vector == 1, "trendsetter", "conformist")

fplot_graph(g)


3.1 diagnostics

3.1.1 dropout

When did people time out?

dropout_long <- data %>%
    filter(!is.na(participant.node)) %>%
    select(participant.label, participant.role, matches("unpop\\.[0-9]+\\.player\\.is_dropout")) %>%
    pivot_longer(cols = matches("unpop\\.[0-9]+\\.player\\.is_dropout"), names_to = "round", values_to = "is_dropout") %>%
    mutate(round = str_extract(round, "[0-9]+"), round = as.numeric(round))

dropout_df <- dropout_long %>%
    filter(is_dropout == 1) %>%
    select(participant.label, participant.role, round)

ggplot(na.omit(dropout_df), aes(x = round)) + geom_bar()

# number of players that experienced time-outs:
dropout_df %>%
    distinct(participant.label) %>%
    nrow()
#> [1] 7
# but only 2 didn't return and thus exited.
table(data$participant.exit)
#> 
#>  0  1 
#> 48  2

3.2 unpopular norm spread

df_long <- data %>%
  filter(!is.na(participant.node)) %>%
  select(participant.label, participant.role, participant.node, starts_with("unpop.")) %>% #also include network node.
  
  pivot_longer(
    cols = matches("unpop\\.\\d+\\.player\\.choice$"),  # only choice columns
    names_to = "round",
    values_to = "choice"
  ) %>%
  mutate(
    round = as.integer(gsub("unpop\\.(\\d+)\\.player\\.choice", "\\1", round)),
    is_bot = ifelse(participant.label == "", TRUE, FALSE)
  ) %>%
  select(participant.label, participant.node, participant.role, round, choice, is_bot)

# aggregated
df_plot <- df_long %>%
  group_by(round) %>%
  summarise(
    pct_choice1 = mean(choice, na.rm = TRUE) * 100,  # proportion * 100
    n = n()
  )

ggplot(df_plot, aes(x = round, y = pct_choice1)) +
  geom_line(group = 1, color = "steelblue", size = .5) +
  geom_point(color = "steelblue", size = 2) +
   geom_hline(yintercept = 10, linetype = "longdash", color = "darkgrey", size = 0.8) +  # dashed line at 10
  scale_x_continuous(breaks = df_plot$round) +
  scale_y_continuous(limits = c(0, 100)) +  
  labs(
    x = "Round",
    y = "% agents choosing 'blue'",
    title = "Evolution of an unpopular norm"
  )

table(data$survey.1.player.enjoyment)
#> 
#>  2  3  4  5 
#>  3  9 14 21
table(data$survey.1.player.clarity)
#> 
#>  3  4  5 
#>  4 12 31
table(data$survey.1.player.majority)
#> 
#>  1  2  3 
#>  8 36  3
fshowdf(unique(data$survey.1.player.strategy))
x
in my opinion, on the first day everyone will start with their preferred color, then its a matter of luck if your preferred color is the majority or not, in this scenario the best option is to match your choice with the majority, then for the rest of the days I followed the majority showed on the first day,
I mainly choose red to ensure the standard 15 points.
Remember previous configuration and align in next set
i chose blue because was the better option to maximize my points and then I was bored and chose red to see what wold happen
the first few times I chose randomly but then decided on red because 3 of my neighbours were red and you get the 15 points extra. Towards the end I saw that one of the neighbours switched to blue and I switched to blue as well because I would get a few more points this way. I was very tempted to leave it as is(red) because of the extra 15 points.
I basically checked what my neighbours are selecting and tried to match , so that all of our chosen color is same , which will help in gaining good points
It was started from red, which guarantees base score, and then try to find to move blue which expects more score
I just did what the others did to maximize my reward to match with them.
looking and my neighbours choices and calculating the number of points
Initially, I chose more blue because the neighbors were going with blue, but one neighbor took the initiative to put red, and then two more joined us, and we managed to do very well.
I attempted to always match at least one neighbour, tried to convince them to move onto my color. In the end, when i couldnt make one neightbour change i just went to his color and the other neighbour followed me.
i simply followed the instruction
idid looked what they were wearing yesterday
started with Red then switched to Blue when neighbours focused on it
I initially prioritized red to secure the 15 point bonus, however once my neighbors coordinated on blue, i have to switch to gain more, i tried to get everyone to pick red for the maximum points, but one neighbor keep choosing blue so i have to secure a steady score
I used basic maths. I was able to facilitate my calculations easily
stacked blue, the other neighbours did the same, and kept the choice till the end
CHOOSING THE ONE WITH MANY POINTS
POINTS EARNED AND NEIGBORS PREDICTABLE CHOICE
At first I choose to stick to red and from time to time choosing blue. After a while I discovered that they are always 2 for blue and 2 for red so I chose blue because it is larger in points
Initially, when all three players selected red, I assumed we all preferred red and wanted to stick to it. When one of the players switched to blue, I realised their preferred colour was actually blue, after which I decided to alternate between red and blue each round. That way, no matter which colour was preferred by each player, we would maximise our score and nobody would feel like they were neglected.
i chose the most dominant color
I started with Red, as it gives me confirm points, but then I moved to Blue for sometime as if my 2 partner coordinate then I will get good points but with risk, then I moved back to my Red to earn bonus. One partner choosing blue all the time but I stick to my Red plan for more points.
After first round, seeing that my two neighbours choose blue, I also choose blue every round to secure 50 points
I believe in people to massively select blue so we can share points together.
At first, I chose red because it was my colour. I kept choosing red during the first 7 rounds. After seeing my neighbours chose blue, I changed my approach and kept choosing blue. I’m happy it worked!
Depending on the previous choices
I realised that my neighbours highly preferred the colour I chose not to pick in the first two round and decided to go for that colour, after 3 rounds I noticed consistent high point gains choosing that colour so I decided to stick to that until the end of the game.
I chose red because I was instructed to choose red. I assumed that other participants might have received the same instruction, so I followed it.
After in the beginning the other players always seemed to pick the opposite of what I picked I ended up deciding to just pick my preferred color, it’s better to get 15 points than to risk getting nothing.
Blue has the possibility to gain more points
I tried to choose the same color as my neighbors. I was trying to keep clicking on the same color, but I noticed that one of the neighbors is choosing everytime the other color, so I switched to choose the same option as him, and fortunately the second neighbor did the same, and then we kept choosing the same color which is red.
The previous choice made me understand how likely the next round would go, for instance if there were two previous red then most likely the next would still be red.
I tried to align with my neighbors. In the end I noticed it doesn´t make a difference if I wear blue or red since I received 46 points either way.
Based on previous selection of neighbors
I followed my partners lead
No strategy
I observed what my neighbours were choosing and when I saw that at least one of them was choosing blue I consistently chose blue as well.
i was choosing any color
I chose what my neighbors chose
i chose what most of my neighbours wore the previous day
Following the pattern of the highest rewards offered
fshowdf(unique(data$survey.1.player.perceived_rq))
x
I’m not sure, the outcome felt obvious to me from the start, I feel like the minority group would easily cooperate in order to achieve the best result, I guess the researcher wanted to see if there would be any attempt of the minority to convert the other group.
How easily people are influenced by certain factors.
I’ve been wondering this the entire experiment. Maybe to see when someone was told that their preference was red, if they would still pick red over blue when they saw that red represented no points?
If I would stick with the same color or switch it up
Study explores the tension between personal preference and the pressure to conform to a social group.
I don’t know
Something about game theory, I guess?!
According to me this experiment is about how individuals choices changes according to other individual in a social group and how others choices impact our choices
How people is moving and where toward move
to learn how individuals adapt their behavior in a social coordination game. the main question was investigating how people balance self interest against social conformity.
having your own preference and coordination with others
I think the objective of this experiment was to understand how people make decisions in group settings when coordination with others is important. The researchers were likely trying to see how individuals balance their own preferences with the need to align with others in order to maximize rewards, and how quickly patterns or conventions emerge within a network.
How people are influenced by their neighbours and what compromises are they willing to take to gain a little more.
to understand how people make decision
decision making
how long people would stick with their colour before changing
I think that maybe the experiment is about social coordination and group influence, it tries to answer if people are willing to give up their preference to follow the majority and secure points
Understanding consumer behaviour, seeing if we are influenced by other people’s behaviour. If you are able to do basic maths using visuals
majority influence on decisions
Collective mindset
PREFFERENCE
how people make decisions
TEAMWORK
They are testing the progression of trust in team and developing trust overtime.
Whether people will try to cooperate and maximise rewards for the entire group, or will they try to stick to their own personal rewards at all cost.
coordination vs preference
Coordination, Cooperation
About how people risk or cooperate together
Decision making in groups
I guess they are trying to prove that individuals try to follow what the majority of the population does because they want to fit it and they don’t want to stand out and feel excluded.
To see whether or nor the other player’s choices will effect the team you are part of
How other people’s behavior can impact person’s decision. And how people communicate to each other without direct ways of contact (in this case, by selecting T Shirt color).
How other group decisions affect individuals personal choices over time
I think the experiment was about how people make decisions when given instructions and whether they try to predict what others will do. It may also be testing if people follow instructions or think independently.
Whether people prefer to play it safe and go with their preferred color or go with the group.
How groups would react to this sort of challenges
How do people make decisions based on what others choose?
about team playing, how one can make decisions with their teammates
They wanted to see how hard it is to align a group of strangers on a decision.
Selection dilemma, probably how neighbours influence decision making.
I do not have a clue
I do not know
I guess it would be about how flexible we are willing to be with our own preferences when the benefit of consensus is greater
fashion
What the majority goes with
to see if you get influenced by the majority
if I’d change my mind if I was given red initially
fshowdf(unique(data$survey.1.player.comments))
x
it’s just a suggestion, i feel like some chaos could benefit the research, for example changing the points the preferred color gives in random days, to a way that could be worth for that day not cooperating with the others. its just an idea I had but I’m not sure it could really be beneficial for the study.
No
No comments
N/A
everything is great
It was interesting, thanks.
no issues
I think the experiment was clear and engaging. The instructions were easy to follow, and the interactive format made it interesting to participate.
nice and great study
Thank you
none
It was a bit frustrating when neighbors wouldn’t coordinate bececause red was clearly the best option
no comment
ENJOYABLE STUDY.
thankyou…this was interesting
All good. Thanks for the invitation.
It was fun, thanks for having me!
I would love to participate in future games like this one. It was really fun!
It was a pleasant and fun task, thank you
The instructions influenced my decision, and I was curious whether others were told the same thing.
i enjoyed the experiment, thank you.
Nope
Thank you for the opportunity, this was a fun experiment to take part in :)
thank you , l really enjoyed this
NA
LS0tDQp0aXRsZTogIkV4cGVyaW1lbnQiDQpiaWJsaW9ncmFwaHk6IHJlZmVyZW5jZXMuYmliDQpsaW5rLWNpdGF0aW9uczogdHJ1ZQ0KZGF0ZTogIkxhc3QgY29tcGlsZWQgb24gYHIgZm9ybWF0KFN5cy50aW1lKCksICclZC0lbS0lWScpYCINCm91dHB1dDogDQogIGh0bWxfZG9jdW1lbnQ6DQogICAgc2VsZl9jb250YWluZWQ6IHRydWUNCiAgICBjc3M6IHR3ZWFrcy5jc3MNCiAgICB0b2M6IHRydWUNCiAgICB0b2NfZmxvYXQ6IHRydWUNCiAgICBudW1iZXJfc2VjdGlvbnM6IHRydWUNCiAgICB0b2NfZGVwdGg6IDQNCiAgICBjb2RlX2ZvbGRpbmc6IHNob3cNCiAgICBjb2RlX2Rvd25sb2FkOiB5ZXMNCi0tLQ0KDQpgYGB7ciwgZ2xvYmFsc2V0dGluZ3MsIGVjaG89RkFMU0UsIHdhcm5pbmc9RkFMU0UsIHJlc3VsdHM9J2hpZGUnLCBtZXNzYWdlPUZBTFNFfQ0KbGlicmFyeShrbml0cikNCmxpYnJhcnkodGlkeXZlcnNlKQ0Ka25pdHI6Om9wdHNfY2h1bmskc2V0KGVjaG8gPSBUUlVFKQ0Kb3B0c19jaHVuayRzZXQodGlkeS5vcHRzPWxpc3Qod2lkdGguY3V0b2ZmPTEwMCksdGlkeT1UUlVFLCB3YXJuaW5nID0gRkFMU0UsIG1lc3NhZ2UgPSBGQUxTRSxjb21tZW50ID0gIiM+IiwgY2FjaGU9VFJVRSwgY2xhc3Muc291cmNlPWMoInRlc3QiKSwgY2xhc3Mub3V0cHV0PWMoInRlc3QzIikpDQpvcHRpb25zKHdpZHRoID0gMTAwKQ0KcmdsOjpzZXR1cEtuaXRyKCkNCg0KY29sb3JpemUgPC0gZnVuY3Rpb24oeCwgY29sb3IpIHtzcHJpbnRmKCI8c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