# [R] [FORGED] how to draw the confidence interval

Rolf Turner r.turner at auckland.ac.nz
Mon Mar 6 09:08:26 CET 2017

```On 06/03/17 19:35, laomeng_3 wrote:

> this is not homework, just a case which I made by myself.

Be that as it may, if you are going to use R you should learn something
about using R, rather than treating it as a magical black box.

There is, as far as I know (not really very far!) no currently existing
function to "draw the confidence intervals".  (Well, actually there is
probably one out there somewhere.  There is so *much* out there.  But
finding it is probably more effort than rolling your own.)

It is actually very easy to roll your own --- I think I could do it in 5
or 10 minutes.  But I am *NOT* going to.  (a) I am not going to do your
work for you, even if it's not homework, and (b) you will *learn*
something by figuring out how to do it yourself.

Hint:  Read up on the functions lines() and segments().  And maybe
arrows().  The function abline() might be of use as well.

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

> On 2017-03-06 06:47 , Rolf Turner <mailto:r.turner at auckland.ac.nz> Wrote:
>
>     On 04/03/17 19:39, laomeng_3 wrote:
>     > hi all I have a question about drawing the confidence interval .
>     >
>     > For instance,if I want to sample 100 times,and each time,the sample
>     > size is 10,and the mean and sd is 15 and 1 respectively .I want to
>     draw
>     > the 100 confidence intervals(as the attachment) .Which function
>     should
>     > be used to draw the confidence interval ?
>