Setup

completion_all <- read.csv("C:/Users/axn821/Box/0 MANATEE Lab/Administrator/1 Studies/1 PreMed Study/12 f2026/6 Survey Data/PME_completion.csv")

library(ggplot2)
library(tidyr)

course_colors <- c(CHM = "#56B4E9", BIL = "#009E73", MTH = "#E69F00")
exam_colors   <- c("1" = "#56B4E9", "2" = "#009E73", "3" = "#E69F00", "4" = "#CC79A7")

plot_completion <- function(cols, labels, colors, x_label, plot_title, measure) {
  cols <- intersect(cols, names(completion_all))
  df_long <- pivot_longer(completion_all, cols = all_of(cols),
                          names_to = "measure", values_to = "value")
  df_long$measure <- factor(labels[match(df_long$measure, cols)], levels = labels)
  print(
    ggplot(df_long, aes(x = value, fill = measure, colour = measure)) +
      geom_histogram(position = "dodge", bins = 30, alpha = 0.6, na.rm = TRUE) +
      scale_fill_manual(values = colors) +
      scale_colour_manual(values = colors) +
      labs(title = plot_title, x = x_label, y = "Count",
           fill = measure, colour = measure) +
      theme_minimal()
  )
}

type_prefix <- c(Nondense = "percent_completion_", Anticipation = "ant_percent_completion_",
                 Dense = "den_percent_completion_")

course_flag <- c(CHM = "CHM_121", BIL = "BIL_150", MTH = "MTH_108")
report_exams <- 1:4

Results

Distribution across classes

Dense Per Exam

People really aren’t engaging with the dense sampling

>= 85% Completion

## Percent completing >= 85% of Nondense surveys for CHM: 73.704
## Percent completing >= 85% of Nondense surveys for BIL: 77.083
## Percent completing >= 85% of Nondense surveys for MTH: 62.5
## Percent completing >= 85% of Anticipation surveys for CHM: 55.253
## Percent completing >= 85% of Anticipation surveys for BIL: 65.035
## Percent completing >= 85% of Anticipation surveys for MTH: 53.125
## Percent completing >= 85% of Dense surveys for CHM: 5.058
## Percent completing >= 85% of Dense surveys for BIL: 15.972
## Percent completing >= 85% of Dense surveys for MTH: 18.75
## Percent completing >= 85% of all surveys for CHM: 27.778
## Percent completing >= 85% of all surveys for BIL: 43.75
## Percent completing >= 85% of all surveys for MTH: 43.75