[R] Showing error distributions in a point plot

phii m@iii@g oii phiiipsmith@c@ phii m@iii@g oii phiiipsmith@c@
Mon Jan 11 16:42:10 CET 2021


I have a point plot where the estimated points have normally distributed 
errors and I want to plot not just the estimated points, but also an 
indication of the range of uncertainty in each case. The usual way of 
doing this, I believe, is with geom_pointrange, as shown in my reprex. 
However, this suggests to the eye that the errors are uniformly 
distributed when in fact they are normally distributed. I would prefer 
to show bell curves instead of straight lines. As far as I have been 
able to determine, there is no R package to help in doing this. I would 
appreciate suggestions as to how best to proceed.

Philip

# Reprex for error distributions
library(ggplot2)
df <- data.frame(x=1:10,y=rnorm(n=10))
ggplot(df)+
   geom_point(aes(x=x,y=y))+
   geom_hline(yintercept=0)+
   geom_pointrange(aes(x=x,y=y,ymin=y-sd(y),ymax=y+sd(y)))



More information about the R-help mailing list