Skip to content
Prev 198984 / 398513 Next

bargraph.ci - CI and color question.

Hello,

Thanks for the responses.  Yes, I did try to use ?bargraph.CI for the
colors. When I said bars,  I meant the main bars on the graph not the
error bars. However, this "col=c("color", "color")" is what I was
needed and while it didn't find in the ?bargraph.ci help, I suspect
its a  more fundamental R thing that I was unaware of.  Regardless,
thank you for the example.

bargraph.CI(dose, len, group = supp, data =ToothGrowth,
+ col=c("gray","black"))

Regarding the confidence intervals.  Yes, I am looking for the 95%
confidence interval of the mean.  Using the ci.fun can I get +/- 1.96
SD?

bargraph.CI(x.factor = dose, response = len, data = ToothGrowth,
ci.fun= function(x) c(mean(x)-sd(x), mean(x) + sd(x)) )

I tried variations on this like,

ci.fun= function(x) c(mean(x)-(1.96*sd(x))), mean(x) + (1.96*sd(x))) )

but this didn't work.  Maybe this approach above seems silly, but I
hope I am exhibiting that I do indeed what the 95% CI for the mean,
but that I am unsure how to have the error bars reflect this using the
ci.fun argument.  Can I use this argument or is some pre-processing
necessary?  If this information is located somewhere besides the
?bargraph.ci help I would greatly appreciate an indication of where it
is.

Thank you kindly,
Michael Just

On Tue, Nov 3, 2009 at 8:53 AM, Manuel Morales
<Manuel.A.Morales at williams.edu> wrote: