[R] prop.test vs hand calculated confidence interval

David Arnold dwarnold45 at suddenlink.net
Thu Apr 4 00:10:03 CEST 2013


Hi,

This code:

n=40
x=17
phat=x/n
SE=sqrt(phat*(1-phat)/n)
zstar=qnorm(0.995)
E=zstar*SE
phat+c(-E,E)

Gives this result:

[1] 0.2236668 0.6263332

The TI Graphing calculator gives the same result.

Whereas this test:

prop.test(x,n,conf.level=0.99,correct=FALSE)

Give this result:

0.2489036 0.6224374 

I'm wondering why there is a difference.

D.



--
View this message in context: http://r.789695.n4.nabble.com/prop-test-vs-hand-calculated-confidence-interval-tp4663245.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list