[R] Error bar

ogbos okike ogbos.okike at gmail.com
Tue Apr 6 19:49:37 CEST 2010


Hi there,
Using the code below I generated the plot attached. The error bars at day =
-3, 2 and 4 appear are larger. I was thinking if there is a way I could make
all the error bars to be of the same size. I don't know if that makes sense.
If not, then, is there a way I can plot only these 3 largest errorbars at
day axis (day = -3, 2 and 4) and omit the rest of the error bars.
I would be much obliged for any help
Warmest
Ogbos
temp<-split(y,x)
 means<-sapply(temp,mean)
 stderr<-function(x)sqrt(var(x)/length(x))
 p<-sapply(temp,stderr)
 n<-sapply(temp,length)
 ciw<-qt(0.975,n)*p/sqrt(n)
  library(gplots)


 day = -5:5
 par(mfrow = c(3,1))

 plotCI(day,means, ciw,gap = 0.05, sfrac= 0.005, type = "l",cex = 1.0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.png
Type: image/png
Size: 4972 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100406/e117e880/attachment.png>


More information about the R-help mailing list