[R] Confidence intervals plot

Marc Schwartz mschwartz at medanalytics.com
Sat Jun 14 21:34:19 CEST 2003


>-----Original Message-----
>From: r-help-bounces at stat.math.ethz.ch 
>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Ramon 
>Martínez Coscollà
>Sent: Saturday, June 14, 2003 1:44 PM
>To: r-help at stat.math.ethz.ch
>Subject: [R] Confidence intervals plot
>
>
>Hi all!!
>
>I am trying to plot several confidence intervals in a unique 
>plot. That is, for each x, I have a confidence interval for a 
>parameter related to x and I would like to plot them in the 
>same plot, in order to compare them. The plot would look like 
>some parallel vertical lines, each one corresponding to a x 
>value. Their extrem points would be the confidence interval limits.
>
>I do not know if I am clear enough. Anyway, thank you in advance.
>
>Ramon.


You have several options depending upon whether you simply want
vertical CI lines above and below xy data points or if you might want
a barplot with CI's.

You could draw the xy data points using plot() and then draw the CI's
yourself using either segments() or arrows() in the base package or
see plotCI(), plotmeans() and barplot2() in the 'gregmisc' package on
CRAN. plotmeans() is a "wrapper" function that can call plotCI().

HTH,

Marc Schwartz




More information about the R-help mailing list