I have a survey that was conducted in 3 different classes (math, phys, bio) at the beginning and at the end of the semester (pre and post). In the survey, there were 3 groups of questions (A, B, C) and a Likert-type scale. I converted all the answers into numerical scores.
I want to test for each course for each question type whether there is a difference in scores between pre and post-term surveys. I also want to add Bonferroni corrections here to account for multiple comparisons:
library(rstatix)
library(tidyr)
df= data.frame(
survey = rep(c("pre","post"),60),
subject = rep(c("bio", "math", "phys"),40),
q = rep(c("A", "B", "C"),40),
score = sample(x=1:7, size = 120, replace = TRUE))
df
df %>% group_by(subject, q) %>%
t_test(score ~ survey, paired = TRUE, p.adjust.method = "bonferroni") %>%
add_significance()
However, p.adjust.method = "bonferroni"
, does not produce any output. I am not sure why.