Two sample proportion test calculator

The two proportion z test calculator with a step-by-step solution compares the proportions of two groups. We updated the calculator on 4-Dec-22 and changed the default continuity correction to don't use (false). (old calculator)

t distribution two tailed

Significance level (α): Continuity correction Calculate the expected h effect size Calculate h Proportion (p̂₁) or successes (x1) Proportion (p̂₂) or successes (x2) Sample size1 (n1) Sample size2 (n2): Step by step Calculate Clear Load last run

Reporting results in APA style

How to do with R? one sample t-test step by step calculation validation message

Two proportion z test calculator

Checks if the difference between the probability of succees (p) of two groups is significant, based on a sample data

Hypotheses
Two proportion z test formula

Two sample proportion test test formula

z distribution two tailed

Normal distribution

What is the continuity correction?

The continuity correction is applied when a continuous distribution is used to approximate a discrete distribution. In the two proportion z test, you use the continuous normal distribution to approximate the discrete binomial distribution.

Should I use the continuity correction?

By using the continuity correction, the results will be more similar to those obtained from the binomial distribution. However, in most cases the results with the normal approximation support a better results than the results with the binomial distribution, or the results with the continuity correction.

When using continuity correction

The continuity correction C adjust the statistic toward the zero.
p̂₁ < p̂₂: F = 1.
p̂₁ > p̂₂: F = -1.
p̂₁ = p̂₂: F = 0.

The continuity correction cannot change the direction of the statistic i.e. correct positive statistic to negative, or vice versa.
C = Min(C, Abs(p1 - p2)).

Please note, the standard deviation in binomial distribution depends on the proportion. Since the null assumption of this test is that the proportions are equal, p1 = p2, when calculating the standard deviations we calculate it based on the pooled proportion:

Since the confidence interval doesn't assume that the proportions are equal, you can't reject the null assumption based on the confidence interval range.

Confidence interval statistics formula

When calculating the confidence interval of the difference between two proportions, we assume unequal proportions, p1 ≠ p2. Hence we calculate the standard deviation of each group based only on the individual group's data. In this caste we use p̂₁ and p̂₂ instead of p̂*₁ and p̂*₂.

Assumptions

  1. Independent samples - the samples were selected randomly and represent the populations.
  2. Binomial distribution - the probability for event within each group is identical
  3. Large sample size - The number of successes and failures in each sample should be large enough to use the normal approximation. As a rule of thumb, a sample size of at least 5 for both successes and failures is recommended.

Required Sample Data

  1. p̂₁, p̂₂ the sample probabilities or x1, x2 the number of successes
  2. n1, n2 - Sample size of group1 and group2

R Code

The following R code should produce the same results:

The prop.test using the Chi-squared statistic with one degree of freedom, which is the same as using the Z test: z 2 =χ 2 (1)