Re: [R] test of proportions

2009-12-29 Thread Peter Ehlers
You need to learn how to use prop.test properly. Is this a ONE-sample test or TWO-sample test? Perhaps this will help: #"hand" calculation phat <- 58/691 p <- 56/691 q <- 1-p n <- 691 z <- (phat-p)/sqrt(p*q/n) z [1] 0.2787970 pnorm(-z)*2 [1] 0.7804006 #"prop.test" prop.test(x=58, n=691, p=56/69

[R] test of proportions

2009-12-29 Thread Roslina Zakaria
Hi r-users,   I would like to use prop.test code and I also calculate manually to test the proportions for 2 groups.  The problem is the answer for the p-value calculated manually are different from prop.test.  Here are the results:   ## Manually   z value: z= (phat-p)/sqrt(pq/n) = (.084-.081)/sq