Hi.
Here's my data:
data.frame(
stringsAsFactors = FALSE,
Threshold = c("99p","99p","99p","99p",
"98p","98p","98p","98p","97p","97p","97p","97p"),
Category = c("Correct","Incorrect",
"Nomatch","Share","Correct","Incorrect","Nomatch","Share",
"Correct","Incorrect","Nomatch","Share"),
Counts = c(106, 111, 43, 126, 80, 116, 37, 153, 74, 122, 22, 168)
)
data <- as.data.frame(data)
ggplot(data, aes(fill=Category, y=Counts, x=Threshold))+
geom_bar(position="dodge", stat="identity")+
labs(title="BOLD match of all butterfly families, share not fixed")+
theme(plot.title = element_text(color = "black", size = 12,
face = "bold", hjust = 0.5))+
scale_fill_brewer(palette="Set2")
Now, onto this barplot, I'd like to add the "expected" values from a chi-square test. Is there any effective way of doing so? Maybe as "error" bars somehow? Here's the results from the chi-square expected values:
data.frame(
check.names = FALSE,
row.names = c("Correct", "Incorrect", "Nomatch", "Share"),
99p
= c(86.6666666666667, 116.333333333333, 34, 149),
98p
= c(86.6666666666667, 116.333333333333, 34, 149),
97p
= c(86.6666666666667, 116.333333333333, 34, 149)
)
Thank you!!