Power analysis for binfd

Read in the data

library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0     ✔ purrr   0.3.4
✔ tibble  3.1.7     ✔ dplyr   1.1.0
✔ tidyr   1.2.0     ✔ stringr 1.4.0
✔ readr   2.1.4     ✔ forcats 0.5.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
library(ggplot2)

df <- read.csv('Power analysis.csv')
head(df,20)
          Policy num_participants Power
1  EpsilonGreedy               89  0.31
2  EpsilonGreedy              101  0.21
3  EpsilonGreedy              654  0.57
4  EpsilonGreedy              692  0.13
5  EpsilonGreedy              762  0.20
6  EpsilonGreedy             7345  1.00
7        RandUCB               89  0.48
8        RandUCB              101  0.38
9        RandUCB              654  0.52
10       RandUCB              692  0.16
11       RandUCB              762  0.27
12       RandUCB             7345  1.00
13      Thompson               89  0.45
14      Thompson              101  0.22
15      Thompson              654  0.59
16      Thompson              692  0.07
17      Thompson              762  0.33
18      Thompson             7345  1.00
19 UCB1-crs-0.35               89  0.43
20 UCB1-crs-0.35              101  0.31

re-creating the Plot the graph:

policy_colors <- c("EpsilonGreedy" = "blue3",
                   "RandUCB" = "orange2",
                   "Thompson" = "green4",
                   "UCB1-crs-0.35" = "red3",
                   "UCB1-crs-1" = "purple3",
                   "uniform" = "brown4")
df |> 
ggplot(aes(x = as.factor(num_participants), y = Power, fill = Policy)) +
  geom_bar(stat="identity", position=position_dodge(), alpha = 0.8)+
  scale_fill_manual(values = policy_colors) +
  labs(title = "Bar Plot of Total Power by Number of Participants and Policy", 
         x = "Number of Participants", 
         y = "Total Power")+
  theme_minimal()

Draw the plot without UCB:

df |> 
  filter(Policy %in% c('EpsilonGreedy','Thompson', 'uniform')) |>
  ggplot(aes(x = as.factor(num_participants), y = Power, fill = Policy)) +
  geom_bar(stat="identity", position=position_dodge(), alpha = 0.8)+
  scale_fill_manual(values = policy_colors) +
  labs(title = "Bar Plot of Total Power by Number of Participants and Policy", 
         x = "Number of Participants", 
         y = "Total Power")+
  theme_minimal()