Right now I am working with my own dataset, which is very similar to the example at https://www.datanovia.com/en/lessons/anova-in-r/, specifically the Three-Way ANOVA section. The code is well laid out, but when I get to the section for visualization using boxplots, I run into an unexpected error.
headache %>%
group_by(gender, risk, treatment) %>%
get_summary_stats(pain_score, type = "mean_sd")
In their code, they assign y as pain score, but for me, I get an error when running it in R:
FUN (x[[i]],...) : object "pain_score" not found
As such, I can't get the plot they make or move farther into analysis.
bxp <- ggboxplot(
headache, x = "treatment", y = "pain_score",
color = "risk", palette = "jco", facet.by = "gender"
)
bxp
All of the packages I have are up to date and I'm not seeing any errors in my code. I've tried other variables in my data set and still have the same issue. When I change it to the mean, I just get the line, not the box plot. If anyone has some input, it would be much appreciated!!