Background

Cerebral venous sinus thrombosis (CVST) is a rare type of blood clot. In the early days of COVID vaccine development, there was concern of an increase in blood clot prevalence attributable to the vaccine.

Some assumptions:

Challenge #1

You are a journalist working on a tabloid newspaper. Produce an eye-catching and dramatic visualisation emphasising the dangers of vaccination, based on relative risk (200% increase in blood clot risk!).

CVST_Prevalence_Background <- 5
CVST_Prevalence_Vaccine <- CVST_Prevalence_Background + 10

data <- data.frame(Group = c("No COVID-19 vaccine", "COVID-19 vaccine"),
                   Relative_Risk = c(CVST_Prevalence_Background, CVST_Prevalence_Vaccine))

data$Group <- factor(data$Group, levels = c("No COVID-19 vaccine", "COVID-19 vaccine"))
y1 <- CVST_Prevalence_Background
y2 <- CVST_Prevalence_Vaccine

ggplot(data = data, aes(x = Group, y = Relative_Risk, fill = Group)) +
  geom_bar(stat = "identity", colour = "black") +
  geom_hline(aes(yintercept = y1), colour = "grey2", linetype = "dashed") +
  annotate("segment", x = 2, y = y1, xend = 2, yend = y2, arrow = arrow(type = "closed", length = unit(0.02, "npc"))) +
  annotate("text", x = 2, y = y2 + 1, label = "+200%", color = "indianred3", hjust = 0.5, size = 8, fontface = "bold") +
  scale_y_continuous(limits = c(0, y2 + 1)) +
  theme_bw() +
  scale_fill_discrete_qualitative(palette = "Dynamic") +
  labs(title = "New study shows that COVID-19 vaccine increased the risk of blood clots by 200%",
       x = "", y = "Relative risk (per million person-years)",
       fill = "CVST by group")

Challenge #2

You work for a medical communications agency, educating healthcare providers and the public on vaccine benefits and risks. Produce an alternative visualisation showing CVST risk of the vaccine on an absolute scale e.g. comparing absolute risks or number needed to harm (NNH).

Do you draw a different conclusion?

data2 <- data
data2$Absolute_Risk_Pct <- data2$Relative_Risk / 1000000 * 100
NNH <- 1/(10/1000000) # NNH = Number needed to harm, inverse of absolute risk increase = 10
data2_left <- data.frame(ID = 1:625)
data2_right <- data.frame(ID = 1:625)

data2_left$X <- (data2_left$ID - 1) %% 25 + 1
data2_left$Y <- (data2_left$ID - 1) %/% 25 + 1
data2_right$X <- (data2_right$ID - 1) %% 25 + 1
data2_right$Y <- (data2_right$ID - 1) %/% 25 + 1

data2_left$Group <- "No CVST"
data2_left$Group[1:CVST_Prevalence_Background] <- "CVST"
data2_right$Group <- "No CVST"
data2_right$Group[1:CVST_Prevalence_Vaccine] <- "CVST"

# data2_left$Icon = fontawesome('fa-person')
# data2_right$Icon = fontawesome('fa-person')

data2_centre <- data.frame(text = "Increase of\n10\nper million person-years")
plot2_left <- ggplot(data2_left, aes(x = X, y = Y, colour = Group)) + 
  geom_waffle(tile_shape = 'circle', size = 3) + 
  coord_equal() + 
  scale_colour_manual(values = c("No CVST" = "grey", "CVST" = "#DB9D85")) +
  theme_waffle() +
  labs(x = paste0("No COVID-19 vaccine: ", CVST_Prevalence_Background, " cases\n(per million person-years)"),
       y = '', colour = '') +
  theme(legend.position = "bottom", axis.title.x = element_text(size = 12))

plot2_right <- ggplot(data2_right, aes(x = X, y = Y, colour = Group)) + 
  geom_waffle(tile_shape = 'circle', size = 3) + 
  coord_equal() + 
  scale_colour_manual(values = c("No CVST" = "grey", "CVST" = "#4CB9CC")) +
  theme_waffle() +
  labs(x = paste0("COVID-19 vaccine: ", CVST_Prevalence_Vaccine, " cases\n(per million person-years)"),
       y = '', colour = '') +
  theme(legend.position = "bottom", axis.title.x = element_text(size = 12))

plot2_centre <- ggdraw() +
  annotate("segment", x = 0, y = 0.8, xend = 1.1, yend = 0.8, arrow = arrow(type = "closed", length = unit(0.02, "npc"))) +
  draw_label("Increase of", fontface = 'bold', size = 10, x = 0.55, y = 0.75, hjust = 0.5, vjust = 0.5) +
  draw_label("10 cases", colour = "#4CB9CC", fontface = 'bold', size = 15, x = 0.55, y = 0.7, hjust = 0.5, vjust = 0.5) +
  draw_label("per million person-years", fontface = 'bold', size = 10, x = 0.55, y = 0.65, hjust = 0.5, vjust = 0.5) 
  
title2 <- "Absolute risk of CVST"
title2_p <- ggdraw() + 
  draw_label(title2, fontface = 'bold', size = 18, x = 0.5, y = 0.5, hjust = 0.5, vjust = 0.5)

plot_grid(title2_p, 
          plot_grid(plot2_left, plot2_centre, plot2_right, nrow = 1, rel_widths = c(1, 0.4, 1)), 
          ncol = 1, rel_heights = c(1, 10))

Some more assumptions:

Infection_Rate <- 0.3
CVST_Prevalence <- 400
VE <- 0.7

CVST_Prevalence_COVID <- CVST_Prevalence * Infection_Rate # 120 cases*
CVST_True_Prevalence_Vaccine <- CVST_Prevalence * Infection_Rate * (1 - VE) + 10 # 46 cases*

Challenge #3

Produce a visualisation communicating the true risk of CVST. Compare CVST prevalence in vaccinated patients (approx. 46 cases) to unvaccinated patients (approx. 120 cases), after accounting for the CVST rate in COVID patients.

data3_left <- data.frame(ID = 1:625)
data3_right <- data.frame(ID = 1:625)

data3_left$X <- (data3_left$ID - 1) %% 25 + 1
data3_left$Y <- (data3_left$ID - 1) %/% 25 + 1
data3_right$X <- (data3_right$ID - 1) %% 25 + 1
data3_right$Y <- (data3_right$ID - 1) %/% 25 + 1

data3_left$Group <- "No CVST"
data3_left$Group[1:CVST_Prevalence_COVID] <- "CVST"
data3_right$Group <- "No CVST"
data3_right$Group[1:CVST_True_Prevalence_Vaccine] <- "CVST"
plot3_left <- ggplot(data3_left, aes(x = X, y = Y, colour = Group)) + 
  geom_waffle(tile_shape = 'circle', size = 3) + 
  coord_equal() + 
  scale_colour_manual(values = c("No CVST" = "grey", "CVST" = "#DB9D85")) +
  theme_waffle() +
  labs(x = paste0("No COVID-19 vaccine: ", CVST_Prevalence_COVID, " cases\n(per million person-years)"),
       y = '', colour = '') +
  theme(legend.position = "bottom", axis.title.x = element_text(size = 12))

plot3_right <- ggplot(data3_right, aes(x = X, y = Y, colour = Group)) + 
  geom_waffle(tile_shape = 'circle', size = 3) + 
  coord_equal() + 
  scale_colour_manual(values = c("No CVST" = "grey", "CVST" = "#4CB9CC")) +
  theme_waffle() +
  labs(x = paste0("COVID-19 vaccine: ", CVST_True_Prevalence_Vaccine, " cases\n(per million person-years)"), 
       y = '', colour = '') +
  theme(legend.position = "bottom", axis.title.x = element_text(size = 12))

plot3_centre <- ggdraw() +
  annotate("segment", x = 0, y = 0.8, xend = 1.1, yend = 0.8, arrow = arrow(type = "closed", length = unit(0.02, "npc"))) +
  draw_label("Decrease of", fontface = 'bold', size = 10, x = 0.55, y = 0.75, hjust = 0.5, vjust = 0.5) +
  draw_label(paste0(CVST_Prevalence_COVID - CVST_True_Prevalence_Vaccine, " cases"), colour = "#4CB9CC", fontface = 'bold', size = 15, x = 0.55, y = 0.7, hjust = 0.5, vjust = 0.5) +
  draw_label("per million person-years", fontface = 'bold', size = 10, x = 0.55, y = 0.65, hjust = 0.5, vjust = 0.5) 

title3 <- "True risk of CVST"
title3_p <- ggdraw() + 
  draw_label(title3, fontface = 'bold', size = 18, x = 0.5, y = 0.5, hjust = 0.5, vjust = 0.5)

plot_grid(title3_p, 
          plot_grid(plot3_left, plot3_centre, plot3_right, nrow = 1, rel_widths = c(1, 0.4, 1)), 
          ncol = 1, rel_heights = c(1, 10))

Challenge #4 (Bonus)

Produce a visualisation from a tipping point analysis: What is the minimum vaccine side effect (CVST additional cases attributable to the vaccine*) at which point the vaccine is worse than unvaccinated patients?

CVST_Risk_Additional <- 10 + CVST_Prevalence_COVID - CVST_True_Prevalence_Vaccine # 84

add_risk <- function(x) {return(CVST_Prevalence * Infection_Rate * (1 - VE) + x)}
ggplot() +
  geom_function(fun = add_risk) +
  labs(title = "Tipping point analysis",
       x = "COVID-19 vaccine, CVST cases\n(per million person-years)", 
       y = "No COVID-19 vaccine, CVST cases\n(per million person-years)") +
  xlim(0, CVST_Prevalence_COVID) +
  geom_hline(aes(yintercept = CVST_Prevalence_COVID), linetype = "dashed", colour = "#DB9D85", linewidth = 0.8) +
  geom_vline(aes(xintercept = CVST_Risk_Additional), linetype = "dashed", colour = "#4CB9CC", linewidth = 0.8) +
  geom_label(aes(x = CVST_Risk_Additional, y = CVST_Prevalence_COVID, label = CVST_Risk_Additional)) +
  theme_bw()

’* Per million person-years