# Re: [R] Re : CI

From: Ethan Johnsons <ethan.johnsons_at_gmail.com>
Date: Thu 19 Oct 2006 - 14:07:44 GMT

Great analogy!
Thanks much for the explanantion.

ej

On 10/19/06, justin bem <justin_bem@yahoo.fr> wrote:
>
>
> Get the the package fortunes in the CRAN and try
> >fortune("Harrell") for experience of and advance R-user. For the second
> question, the binomial distribution converge to normal distribution
> asymptomaticaly. You can not expect get the same result by using the two
> approximations on a finite sample. Watching a football macth in a TV screen
> is not the same thing that see the game in a staduim.
>
> Justin BEM
> Elève Ingénieur Statisticien Economiste
> BP 294 Yaoundé.
> Tél (00237)9597295.
>
>
>
> ----- Message d'origine ----
> De : Ethan Johnsons <ethan.johnsons@gmail.com>
> À : "Liaw, Andy" <andy_liaw@merck.com>
> Cc : r-help@stat.math.ethz.ch
> Envoyé le : Jeudi, 19 Octobre 2006, 5h43mn 36s
> Objet : Re: [R] CI
>
>
> Thx so much.
>
> I just got into R world for my small research.
> I thought that R is free so doesn't have many features, but it seems I
> was wrong.
>
> Why do these two return different values?
>
> 0.2666456 0.6133544
> 0.2698531 0.6213784
>
> I think the diff is ignorable, but would ask.
>
> ej
>
> On 10/19/06, Liaw, Andy <andy_liaw@merck.com> wrote:
> > You did ask for CI of mean, so that's what you got. If you want CI for
> > proportion, here are two (non-bootstrap) ways:
> >
> > R> confint(lm(I(x == 1) ~ 1), level=.9)
> > 5 % 95 %
> > (Intercept) 0.2666456 0.6133544
> > R> binom.test(sum(x == 1), length(x), conf.level=.9)
> >
> > Exact binomial test
> >
> > data: sum(x == 1) and length(x)
> > number of successes = 11, number of trials = 25, p-value = 0.69
> > alternative hypothesis: true probability of success is not equal to 0.5
> > 90 percent confidence interval:
> > 0.2698531 0.6213784
> > sample estimates:
> > probability of success
> > 0.44
> >
> > I hope these are not HW problems?
> >
> > Andy
> >
> > From: Ethan Johnsons
> > >
> > > Thank you so much for the feedback.
> > >
> > > The random numbers are working great. I have tried
> > > non-random numbers, and the outcome is not correct with confint.
> > >
> > > Is there a way to compute i.e. a 90% confidence interval for
> > > percent of 1?
> > >
> > > i.e. where 1 = apple; 2 = orange
> > >
> > > > x
> > > [1] 2 2 2 2 2 1 1 2 2 1 2 1 2 2 2 1 1 1 1 1 1 1 2 2 2
> > > > table (x)
> > > x
> > > 1 2
> > > 11 14
> > >
> > > > x =11
> > > > confint(lm(x~1), level=0.90)
> > > 5 % 95 %
> > > (Intercept) NaN NaN
> > >
> > > ej
> > >
> > > On 10/18/06, Liaw, Andy <andy_liaw@merck.com> wrote:
> > > > Here's one way:
> > > >
> > > > R> x <- c(6,11,5,14,30,11,17,3,9,3,8,8) confint(lm(x~1), level=.9)
> > > > 5 % 95 %
> > > > (Intercept) 6.546834 14.2865
> > > >
> > > > Andy
> > > >
> > > > From: Ethan Johnsons
> > > > >
> > > > > I have a quick question, please.
> > > > >
> > > > > Does R have function to compute i.e. a 90% confidence
> > > interval for
> > > > > the mean for these numbers?
> > > > >
> > > > > > mean (6,11,5,14,30,11,17,3,9,3,8,8)
> > > > > [1] 6
> > > > >
> > > > > I thought pt or qt would give me the interval, but it seems not.
> > > > >
> > > > > thx much.
> > > > >

> > > > > ej
> > > > >
> > > > > ______________________________________________
> > > > > R-help@stat.math.ethz.ch mailing list
> > > > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > > > http://www.R-project.org/posting-guide.html
> > > > > and provide commented, minimal, self-contained, reproducible code.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> ----------------------------------------------------------------------
> > > > --------
> > > > Notice: This e-mail message, together with any
> > > attachments, contains
> > > > information of Merck & Co., Inc. (One Merck Drive,
> > > Whitehouse Station,
> > > > New Jersey, USA 08889), and/or its affiliates (which may be known
> > > > outside the United States as Merck Frosst, Merck Sharp &
> > > Dohme or MSD
> > > > and in Japan, as Banyu - direct contact information for
> > > affiliates is
> > > > available at
> http://www.merck.com/contact/contacts.html)
> > > that may be
> > > > confidential, proprietary copyrighted and/or legally
> > > privileged. It is
> > > > intended solely for the use of the individual or entity
> > > named on this
> > > > message. If you are not the intended recipient, and have
> > > > message in error, please notify us immediately by reply e-mail and
> > > > then delete it from your system.
> > > >
> > > >
> > >
> ----------------------------------------------------------------------
> > > > --------
> > > >
> > >
> > >
> > >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Notice: This e-mail message, together with any attachment...{{dropped}}
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ________________________________
> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions
> ! Demandez à ceux qui savent sur Yahoo! Questions/Réponses.

R-help@stat.math.ethz.ch 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. Received on Fri Oct 20 09:33:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 20 Oct 2006 - 00:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.