I have this graph:
Which shows male and female heights along with the confidence interval of 95% for the mean. There's an issue tho, I can't seem to show one confidence interval for Males and one for Females. Both of the errorbars appear on both labels in the x axis. Would you be able to help me adjust me code to show the female CI (in blue) on the Female range, and the male CI (in red) for the Male range?
Here's my plot code:
gSE <- ggplot(data = sample.Height, aes(x=sample, y=heightIn)) +
geom_point() +
geom_errorbar(aes(ymin=heightFemale.sampleMean-0.7970899, ymax=heightFemale.sampleMean+0.7970899), colour="blue", width=.1) +
geom_errorbar(aes(ymin=heightMale.sampleMean-1.0322975, ymax=heightMale.sampleMean+1.0322975), colour="red", width=.1) +
labs(title = "Male and Female Heights", x = "Gender", y = "Heights in Inches") +
theme_light()
gSE
Thank you,