1
votes

I am trying to use ggplot to show a series of confidence intervals across different time points. I have two sets of confidence intervals, one parametric and one bootstrap, and I would like to display them using geom_errorbar(). I tried using position_dodge() so the two CI won't directly overlay one another, but it is not working. How do I jitter the CI at the same time point?

pd <- position_dodge(.6)
ggplot(results, aes(x=intervals, y = change)) +
geom_errorbar(aes(ymin=ci.par.low, ymax=ci.par.hi), position = pd, width=.1, colour =
"green") + 
geom_errorbar(aes(ymin=ci.boot.low, ymax=ci.boot.hi),  width=.1, colour = "blue") +
geom_abline(intercept = slope.est, slope = 0, colour = "red") +
labs(title = paste("Protein ID:", prot.name))
1
Could add some sample data. If x values are numeric then for one geom_errorbar() you could set x values as x=intervals+some small constant - Didzis Elferts

1 Answers

0
votes

I accomplished my goal with position_jitter(), though it's clunky.