To copy the code, click the button in the upper right corner of the code-chunks.
rm(list = ls())
gc()
We defined a number custom functions, at Download custom_functions.R.
source("./custom_functions.R")
tidyverse: data wranglingigraph: generate and visualize graphsparallel: parallel computing to speed up
simulationforeach: looping in paralleldoParallel: parallel backend for
foreachggplot2: data visualizationggh4x: hacks for ggplot2ggpubr: make visualizations publication-readypackages = 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)
data <- read.csv("./rawdata/all_apps_wide_2026-03-23-ii.csv")
times <- read.csv("./rawdata/PageTimes-2026-03-23-ii.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)
On 23-03-2026, I recruited 59 Prolific participants via a brief sign-up survey to populate a network of N=50 (with a 10% minority group).
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)

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] 9
# players exiting after recurring timeouts:
table(data$participant.exit)
#>
#> 0 1
#> 46 4
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
#> 4 10 15 8
table(data$survey.1.player.clarity)
#>
#> 4 5
#> 11 26
table(data$survey.1.player.majority)
#>
#> 1 2 3
#> 6 27 4
fshowdf(unique(data$survey.1.player.strategy))
| x |
|---|
| Stuck with red to start and when I realised most people were going blue i swapped to maximise my points |
| Stuck with red as instructed unless both neighbours had blue the previous round, then changed to blue. Since at least one neighbour had red the next round, switched back from blue to red |
| I looked at what my neighbors were choosing the previous rounds. |
| mostly agreement between neighbors |
| I was just trying to cooperate with others and win as much points as I can. |
| Seeing my neighbors selecting blue and judging the return on investment of that color, I chose to always stick with blue to maximize gains. |
| Tracking how other players respond and highest payoff |
| Start with my color so signal which one was mine, then choose and stay with the majority choice the rest of the game - which happened to be all blue. |
| I wanted to pick red shirt at first, but I trusted people wanted all neighbours benefits so I decided to pick blue and based on people picks I still picked it, even though at first various neighbours picked red shirt. |
| It depended on knowing what my neighbors chose the day before |
| The second player almost always chooses the same skirt |
| I used the previous day’s selections because I knew that was the color that the other participants preferred to choose. |
| I started with red since it was a sure win. But then I started to notice that my neighbors were choosing blue and since it had higher profit, I chose blue for the rest of the days. |
| Well first i chose the color i got picked which was red, Then i saw more people using blue but i stayed red too see if people switched, They did not so i switched to blue then just picked blue. |
| what my partner wore |
| what neighbors were choosing previously. |
| I used a coordination-based strategy. |
| I saw there was a prefrence for blue and followed it to maximize point gain for myself and other group members |
| Choose the one that more people chose. |
| Tried to stay consistent with one of my neighbors that chose blue throughout the study. |
| In the beginning I went with the majority and kept choosing blue. But towards the end, someone started to choose red, so I chose red to see if we can influence people into switching to red, but was unsuccessful. |
| if they choosed blues yesterday i choose the same and then i just went with blue |
| You try to push others to follow you in a try to get more income, however, sometimes the others don’t follow, so you have to return to the starting point and try again, eventually they will agree with your scheme. |
| I went with the group. In this case I kept picking blue |
| I tried to coordinate my choice with my neighbors to maximize points. I usually chose the color that most of my neighbors picked in previous round. |
| I went with whatever produced the highest number |
| Firstly I wanted to stay to my color, but I risked and picked blue. After some time I saw that picking blue was a better deal, so I did it a copule of times. I wanted to switch back to red, cause I saw my neighbours picked red sometimes, but it didn’t work. |
| I just went with the safest option. |
| the greater good, always choose blue, it was the way of getting more points even if that risked to get 0, there was aroun a 60% chance that someone else will select blue as well, so i took the chance |
| At first, I thought we’re better off all doing blue, then I experimented to see if maybe all red could work but since it didn’t after a few rounds, I stuck to blue to maximise points. |
| Saw the way it was trending (Blue) and just kept rolling with it |
| started with red as this was the best but then went blue |
fshowdf(unique(data$survey.1.player.perceived_rq))
| x |
|---|
| See if others decisions affect people |
| About how others can influence yourself. How environment can shift you and your opinion |
| they are trying to answer a question related to people getting influenced by their close people maybe. |
| relating to group decisions and compromise |
| In my opinion, the researchers attempted to investigate the impact of the other peope decisions. |
| I believe the experiment seeks to understand how a pattern occurs. For example, I believe that if two people chose blue and one chose red, in the next round the pattern to follow was blue, and so it continued until the end. |
| How people decide |
| The experiment was about observing if people will give in to peer pressure and switch the financially good option |
| Cooperation and signalling |
| I think researchers want to test people identity to a group, pursuing everyone’s benefit instead of only one person benefit. |
| I think it was about to know how people make decisions |
| Play with AI |
| If previous selection would influence future decisions. Do people make decisions based on other’s influence? |
| I think it was regarding how a human mind works regarding doing the obvious or taking a risk and how it is affected by what others do. |
| maybe too see how fast people would cooperate and if people were willing to sacrifice 5 points to potentially earn more? |
| peer pressure |
| to know how strangers make decisions based on different situations. |
| The experiment seems to be about social coordination and collective behavior. |
| Analyzing people’s selfishness/priorities |
| I don’t know. |
| I guess trying to identify if people will move out to the mayority even if they don’t get reward |
| Influence about group decisions |
| Cooperation between people when faced with a reward. |
| To see how we change behavior depending on the majority. |
| The way that people can influence in others decisions. |
| If you choose to go with the group or stick to your choice |
| I honestly have no idea. may be to see who follows the previously given instructions. |
| This study was about how people make decisions in a group and how they coordinate with others when are different preferences. |
| Working with others |
| Going after the group, picking safest option, risk and prize balance |
| risk taking |
| I don’t really know but I think it was to see if will change their mind mid test because everyone else was selecting the other choice |
| Whether people will adjust to others to secure larger benefits. |
| Choices between assured vs. chance outcomes |
| conformity and herd behavior |
fshowdf(unique(data$survey.1.player.comments))
| x |
|---|
| No, everything was good. Thank you. |
| I loved being part of this study, thanks! |
| I think this is a pretty well done and enjoyable research, keep doing things like this! |
| None |
| nope |
| No, Thank you for this experience. |
| no thank you. |
| everything was clear and went well |
| The game should change the points of the colors mid game, making it more challenging |
| No Comments |
| The game was clear and easy to follow. |
| nothing to add |
| thanks! |
Copyright © Rob Franken