R-beta: plot with error bars?

Peter Dalgaard BSA p.dalgaard at kubism.ku.dk
Fri Sep 19 18:39:29 CEST 1997


Bill Simpson <wsimpson at uwinnipeg.ca> writes:

> 
> I have read the Venables & Smith Notes on R.
> I was wondering if someone could tell me how to make an XY plot with error
> bars.
> 1. x holds x values, y holds y values, ci contains confidence interval
> (error bar stretches from y-ci to y+ci)
> 2. x, y, ucl contains upper confidence limit, lcl contains lower
> confidence limit.  Error bar stretches from lcl to ucl. Need this for
> asymmetrical error bars.

Try refinements of the following:

> x<-rnorm(10)
> y<-rnorm(10)
> plot(x,y)
> arrows(x,y+.1,x,y-.1,length=.05,angle=90,code=3)

- or segments(x,y+.1,x,y-.1), maybe

[actually, we could do with an errbar function that essentially does
the arrows call above]

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the R-help mailing list