# [R] Confidence interval

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Nov 22 22:54:19 CET 2000

```
gbrajovic at entelchile.net wrote:
>
> I have this question I hope you can answer. First, lets see this simple example, using the Student's t-test:
>
> > test<-t.test(miTest.data, mu=0.5, conf.level=0.90 )
> > test
>
>          One Sample t-test
>
> data:  miTest.data
> t = 0.5222, df = 9, p-value = 0.6141
> alternative hypothesis: true mean is not equal to 5
> 90 percent confidence interval:
>  3.744928 7.255072
> sample estimates:
> mean of x
>       5.5
>
> The question is: what kind of expression should I use to get the confidence interval? That is, what expression should <exp> be, so
>
> > confInterval <- <exp>
> > cinfInterval
> [1] 3.744928 7.255072

Example:

my.t.test <- t.test(rnorm(100))
str(my.t.test)
# So you see, that <exp> can be replaced with:
my.t.test\$conf.int[1:2]

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```