Is this what you are trying to do?
Next time post a reproducible example of some data.
library(tidyverse)
# fake data - next time post it so I don't have to do it
df <- tibble(anxiety = runif(50, 0, 100),
sex = factor(rep(c("male", "female"), 25)),
fav_col = factor(sample(c("blue", "green", "red"), 50, replace = TRUE))
)
# anova
data <- Rmisc::summarySE(df,
measurevar = "anxiety",
groupvars = c("sex", "fav_col"))
ggplot(data, aes(sex, anxiety, fill = fav_col)) +
geom_bar(stat = "identity",
position = position_dodge(),
width = 0.4) +
geom_errorbar(aes(ymin = anxiety - ci, ymax = anxiety + ci),
width = 0.4,
position = position_dodge()) +
labs(x = "Sex", y = "Anxiety") +
theme_classic()