Skip to content

bargraph.CI change se for sd

5 messages · herwig, David Winsemius

#
Hi there, 
I am a beginner.
I would like to change the error bars in the bargraph.CI function from the
default (se) to (sd). The help file says
ci.fun= function(x) c(fun(x)-se(x), fun(x)+se(x))
Is there a simple way of telling the function what (x) precisely is - I
already define in in the  of the bargraph.CI function and assume that is
should be able to use that information.

cheers,
Herwig
#
Package name?
Example code?

--
On Mar 21, 2009, at 4:22 AM, herwig wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
Sorry about forgetting that.

Package "sciplot"

Simple example code:
This code plots the standard error on the bars; I would like to replace that
by the standard deviation

bargraph.CI(peptide, surface, group=adjunct,data = y)
David Winsemius wrote:

  
    
#
> bargraph.CI(peptide, surface, group=adjunct,data = y)
Error in eval(substitute(subset), envir = data) : object "y" not found
#    groan, ... why can't people offer a workable example?
 > data(ToothGrowth)
# se as default
 > bargraph.CI(x.factor = dose, response = len, data = ToothGrowth)
# create desired function
 > bargraph.CI(x.factor = dose, response = len, data = ToothGrowth,
               ci.fun= function(x) c(mean(x)-sd(x), mean(x) + sd(x)) )

QED
On Mar 21, 2009, at 4:09 PM, herwig wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
Thanks for the solution.
And sorry about the not workable example (I actually edited the post a
minute after posting it -too late I am afraid).

 


 > library(sciplot)
 > bargraph.CI(peptide, surface, group=adjunct,data = y)
Error in eval(substitute(subset), envir = data) : object "y" not found
#    groan, ... why can't people offer a workable example?
 > data(ToothGrowth)
# se as default
 > bargraph.CI(x.factor = dose, response = len, data = ToothGrowth)
# create desired function
 > bargraph.CI(x.factor = dose, response = len, data = ToothGrowth,
               ci.fun= function(x) c(mean(x)-sd(x), mean(x) + sd(x)) )