hi, i am trying to generate nice barplots with std-errors. do i really have to generate the std-errors myself by the segments() command ? thanks for help, jan -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jan, I know what you mean - it seems like a unnecessary pain. BUT, (to repeat the mantra) R is a programming language and it is not too hard to make such a function (check archives for plotCI by Ben Bolker, based on code by B. Venables) or to write the code for one time use (see http://lark.cc.ukans.edu/~pauljohn/R/statsRus.html Maintained by Paul Johnson). At 08:40 AM 3/13/2002 +0100, Jan Malte Wiener wrote:>hi, > >i am trying to generate nice barplots with std-errors. >do i really have to generate the std-errors myself by the segments() command ? > >thanks for help, >jan > > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- >r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html >Send "info", "help", or "[un]subscribe" >(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._Martin Henry H. Stevens, Assistant Professor 338 Pearson Hall Botany Department Miami University Oxford, OH 45056 Tel: (513) 529-4206 FAX: (513) 529-4243 http://www.muohio.edu/~botcwis/bot/henry.html -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> hi, > > i am trying to generate nice barplots with std-errors. > do i really have to generate the std-errors myself by the segments() > command ? > > thanks for help, > janHello Jan Some time ago I wanted to do the same thing. I wrote a function, which works in the way similar to lines(). The code is below. erbars <- function(yl,ym,yh, x=1:length(yl), w=1/2, ...) { points(x,ym, pch=22, ...) for(i in 1:length(x)) { lines(rep(x[i],2), c(yl[i],yh[i]), lty="dashed", ...) lines(c(x[i]-w/2,x[i]+w/2), rep(yh[i],2), ...) lines(c(x[i]-w/2,x[i]+w/2), rep(yl[i],2), ...) } } It will draw a sequence of 'errorbars' (see example below) on the active device. The meaning of arguments: yl - a vector specyfying values of lower whisker points ym - a vector specyfying values of middle points yh - a vector specyfying values of higher whisker points x - vector of x coordinates of whiskers w - width of the ticks With this function you should be able to add standard errors to your barplot. Hope this helps, regards Michal EXAMPLE x <- rbinom(1000,2,0.4) y <- 10*x+2+rnorm(length(x),0,5) f <- as.factor(x) plot.new() plot.window(c(0,4),c(min(y),max(y))) axis(1); axis(2) erbars(tapply(y,f,min),tapply(y,f,mean), tapply(y,f,max), w=0.2) -- Okresl Swoje potrzeby - my znajdziemy oferte za Ciebie! [ http://oferty.onet.pl ] -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._