I need to creat one line above my two columns graph comparing the p value (found on my chi squared test). I need help creating a simple code to add on my graph code.
i used the ggstatsplot
my code:
test <- chisq.test(table(data_xxxx$yyyy_tipo, data_xxxx$zzzz))ggbarstats(data_xxxx, zzzz, yyyy_tipo,results.subtitle = FALSE, perc.k = 2,subtitle = paste0("Fisher's exact test", ", p-value = ",ifelse(test$p.value < 0.0001, "< 0.0001",round(test$p.value, 3)))) +
scale_fill_manual(values = c("yes" = "khaki", "no" = "mediumpurple3")) +
xlab("Presença de trauma") +
ylab("Apresentação do TDAH") +
guides(fill = guide_legend(title = "Tipo de Trauma"))`
New contributor
user26842578 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.