[R] CI

Ethan Johnsons ethan.johnsons at gmail.com
Thu Oct 19 06:08:04 CEST 2006


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 at merck.com> wrote:
> Here's one way:
>
> R> x <- c(6,11,5,14,30,11,17,3,9,3,8,8)
> R> 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 at 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.
> >
> >
> >
>
>
> ------------------------------------------------------------------------------
> Notice:  This e-mail message, together with any attachment...{{dropped}}



More information about the R-help mailing list