I'd recommend something along these lines:

set.seed(32438786)

plot.new()
plot.window(xlim=c(-.5,.5),ylim=c(1,50))


for(i in 1:50){
X <- rnorm(100)
CI <- confint(lm(X~1))
ifelse( sum(0 > CI) == 2 | sum(0<CI)==2 , line.col <- "red", line.col <-
"black" )
lines(CI,c(i,i),lwd=2, col=line.col)
}

box()
axis(1)
abline(v=0, col="blue",lwd=3)

-tgs


On Thu, Nov 21, 2013 at 6:09 AM, Preetam Pal <lordpreetam@gmail.com> wrote:

> 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.
> 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?
>
> 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@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.
>

	[[alternative HTML version deleted]]

