Hypothesis Testing – Chi-Square Test vs Z-Test for Comparing Two Proportions

binomial distributionhypothesis testingp-valueproportion;r

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?

Best Answer

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