Message-ID: <47D948D4.60207@comcast.net>
Date: 2008-03-13T15:31:32Z
From: Marc Schwartz
Subject: how to generate bar charts with the standard deviation
In-Reply-To: <462b7fdd0803130733x2bd8f4b9jc272f9f931f1e9e2@mail.gmail.com>
Ng Stanley wrote:
> Hi,
>
> I have the two vectors mean and sd of individual columns, but I am unsure
> how to generate bar charts with the standard deviation, even after looking
> the help of barplot and barplot.2.
Barplots are not well suited for presenting continuous data and many
would argue that even for proportions, they should not be used to
present CI's.
You are better off using:
1. plotCI() in the gplots package:
http://cged.genes.nig.ac.jp/RGM2/R_current/library/gplots/man/plotCI.html
2. plotmeans() in the same, which is a wrapper to the above:
http://cged.genes.nig.ac.jp/RGM2/R_current/library/gplots/man/plotmeans.html
3. errbar() in the Hmisc package:
http://cged.genes.nig.ac.jp/RGM2/R_current/library/Hmisc/man/errbar.html
4. arrows() and/or segments() in the default R installation, which can
be used like errbar() to add CI's to points.
HTH,
Marc Schwartz