# Chi-square test or Z-test for comparing two proportions?

On this website the appropriate statistical test for comparing two independent proportions is described as a $$Z$$-test (a normal distribution is used to obtain a $$p$$-value).

However, in R prop.test, a Chi-square distribution is invoked to obtain the $$p$$-value comparing two independent proportions.

An R example is:

prop.test(x = c(474, 376), n = c(750, 750))


I was wondering how a Chi-square based approach comparing two independent proportions works (e.g., is the test a chi-square test or a different test that produces a statistic that follows a Chi-square distribution) and how it compares with the Z-test approach (e.g., in terms of accuracy and power) discussed on that website?

• If you check prop.test, chisq.test and z-test on your data then they all give you the same p-value = 3.285e-07. All tests should be conducted without continuity correction. Jun 25 '17 at 17:17
• The chi-square statistic is the square of the z-statistic. They both relate to the one degree of freedom in the outcome, which is basically related to a single variable that is approximately Gaussian distributed. I wouldn't be surprised that you can convert the two statistics in one or another. Feb 2 '19 at 11:50

Caveat: This is my non-statistician view of the question.

The following website discusses the two approaches. The prop.test approach is the statistically fundamental one. The z-test approach is, in my eyes, an approximation of this, and relies on certain assumptions about the data.

www.r-bloggers.com/comparison-of-two-proportions-parametric-z-test-and-non-parametric-chi-squared-methods/

Since R has good support for tests of proportions (confidence intervals, binom.test, multinomial.test), I don't see why one would want to use the z-test approach. But that may just be my bias and particular education.

Considering using confidence intervals in R, the following two pages have examples of confidence intervals for proportions, binom.test, and multinomial.test in R. (Caveat: I am the author of these two webpages.)

rcompanion.org/handbook/H_03.html

rcompanion.org/handbook/H_02.html