[R] bars with sd
Matteo Vidali
vidali at med.unipmn.it
Fri May 21 11:03:43 CEST 2004
I need some help for a curious question of a friend of mine.
She usually does some experiments (3-5 repeats for each exp) and then she
calculates mean and standard deviation.
In microsoft excel she writes something like the following
sample mean sd
a 1.25 0.35
b 2.65 0.65
c 3.45 0.50
She can do a vertical barplot graph just giving mean value and specifying
the standard deviation value for each bar in the graph.
My friend wants to know if it is possible to do the same with R. She has
tried also with Open Office and seen that in that program you can plot mean
values as bars but it is not possible to specify a different sd for each
bar 'cause the program, if you ask to put the standard deviation, calculates
a common sd using the mean values.
I was not able to give her an answer for the barplot function in R. I have
just said to her that it is likely due to the fact that using a barplot
graph to plot mean and standard deviation values it is non a good practice,
since the height (or the area) of bars should represent frequency and that
putting a standard deviation in that way it is at least quite confusing for
the reader to interpret the graph. Some scientific journal revisors
discourage this practice. She should instead use a boxplot or just plotting
the different repetition values for each sample as points and add a linea
indicating the mean.
But if this is correct why in some programs like open office you can plot
bars with a common standard deviation???? when will you need this last type
of graph?
any suggestion? any help?
thanks in advance
Matteo
More information about the R-help
mailing list