[R] Plotting multiple confidence intervals in the same graph

PIKAL Petr petr.pikal at precheza.cz
Thu Nov 21 15:13:27 CET 2013


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Preetam Pal
> Sent: Thursday, November 21, 2013 12:10 PM
> To: r-help at r-project.org
> Subject: [R] Plotting multiple confidence intervals in the same graph
> Hi,
> I have 100 observations X1,X2,......,X100 and the confidence interval
> limits for the mean at 5% level of significance.
> I wanted to repeat this procedure say 50 times and see how many times
> the hypothetical mean is included in the confidence intervals.

Hm, I do not understand well what procedure you want to repeat 50 times?

> Analytically I have done this, but I am thinking if I can plot the 50
> confidence interval in the same graph and may be have a vertical line
> denoting the hypothetical mean. This will be a good visual
> representation I think.Can I use different colors as well?

If you want to have 50 colours you will not be able to distinguish differences. How do you want to plot 50 confidence intervals?

Something like that comes to mind but you shall be more specific about what do you want

plot(1,1, type="n")
arrows(1,.8,1,1.2, angle=90, code=3)
abline(h=1.1, col=2)


> I request for your help on this.
> Thanks and Regards,
> Preetam
> --
> Preetam Pal
> (+91)-9432212774
> M-Stat 2nd Year,                                             Room No.
> N-114
> Statistics Division,
> C.V.Raman
> Hall
> Indian Statistical Institute,                                 B.H.O.S.
> Kolkata
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list