Skip to content

Confidence bands in ggplot2

4 messages · Abhijit Dasgupta, Christopher David Desjardins

#
You can easily do this by:

qplot(x=as.factor(sch),y=est, geom='point', colour='red') +
geom_pointrange(aes(x=as.factor(sch), y=est, ymin=lower.95ci, ymax=upper.95ci))+
xlab('School') + ylab("Value-added")+theme_bw()
On 07/07/2011 05:55 PM, Christopher Desjardins wrote:
#
Thanks that worked perfectly. One thing if I may. Is it possible to make the center dot red and the lines connecting the dots black?

Thanks,
Chris
On Jul 7, 2011, at 5:10 PM, Abhijit Dasgupta, PhD wrote:

            
#
It's basically a question of layering, and the order in which the layers are drawn. Draw the pointranges first and then the points:

qplot(x=as.factor(sch), y=est, ymin=lower.95ci, ymax=upper.95ci, geom='pointrange')+
	geom_point(aes(x=as.factor(sch), y=est), color='red')+...
On Jul 7, 2011, at 6:16 PM, Christopher Desjardins wrote: