Understand the idea
This test handles yes/no outcomes expressed as rates: click-through rates, conversion rates, defect rates, approval rates. It comes in two flavors. The TWO-PROPORTION version compares the success rate between two independent groups (does ad variant A convert better than variant B?). The ONE-PROPORTION version compares a single observed rate against a fixed target (is our defect rate different from the industry-standard 5%?).
For the two-group comparison, three different but related numbers describe the gap between the groups: the RISK DIFFERENCE (simple subtraction: how many more percentage points), the RISK RATIO (how many times more likely a success is in one group versus the other), and the ODDS RATIO (the ratio of the ODDS, a related but subtly different quantity). Risk ratio and odds ratio are close together when both proportions are small, but they diverge more as the proportions get closer to 1, so always check which one you're actually reading.
Both versions of this test rely on the normal approximation to the underlying binomial distribution, which needs a reasonable number of BOTH successes AND failures in each group to be trustworthy; a common rule of thumb is at least 10 of each. When that condition isn't met, an exact alternative (Fisher's exact test for two groups, an exact binomial test for one) is the more reliable choice.
The two-proportion z-test compares two groups' proportions, and the one-proportion z-test compares a single proportion with a target value. Cohen's h is the effect size for a difference between two proportions. The Wilson score interval is a confidence interval for a proportion that behaves well even near 0% or 100%.
Practitioner explanation
KernelStats deliberately uses DIFFERENT standard errors for the test versus the confidence interval, and states this explicitly as correct behavior, not a bug: the two-proportion TEST statistic z=(p1-p2)/sqrt(p-pooled*(1-p-pooled)*(1/n1+1/n2)) uses the POOLED proportion (correct under H0: p1=p2, where both groups genuinely share one true rate), while the risk-difference CONFIDENCE INTERVAL uses the UNPOOLED standard error sqrt(p1(1-p1)/n1 + p2(1-p2)/n2), since ESTIMATION does not assume the two proportions are equal. The one-proportion test similarly uses p0 (the hypothesized value), not the sample proportion, in its null standard error, the same logic applied to the single-sample case.
For the one-proportion confidence interval, KernelStats reports BOTH the Wald interval (p-hat +/- z*sqrt(p-hat(1-p-hat)/n)) and the Wilson score interval side by side, with the product stating directly that Wilson stays mechanically inside [0,1] and is FAR MORE ACCURATE for small n or proportions near 0 or 1; the Wald interval can extend below 0 or above 1 in exactly those situations, a well-known defect the Wilson interval avoids by construction.
The success level (which of the two distinct values in a binary column counts as a 'success') is resolved automatically: it first checks for a recognizable positive token (1, 'yes', 'true', 'success', 'positive', 'pass', case-insensitively), falling back to the LARGER of the two distinct values if no such token is found; this resolution logic is applied consistently rather than left to alphabetical or arbitrary ordering, and a manual override is available. Cohen's h uses the arcsine (variance-stabilizing) transform specifically so the effect size stays comparable across the WHOLE 0-to-1 range of proportions: an ordinary risk difference of a fixed size means something very different near p=0.5 than near p=0.05, and the arcsine transform is what makes Cohen's benchmarks (0.2/0.5/0.8) apply consistently regardless of where the proportions sit.
When to use it
Consider it when
You have a binary (yes/no) outcome and want to compare its success rate between two independent groups, or against a fixed target proportion, with each group having a reasonable number of both successes and failures (roughly 10+ of each).
Use caution when
Either group has fewer than about 10 successes or failures (use Fisher's exact test for two groups, or an exact binomial test for one proportion, instead of the normal approximation this z-test relies on), or the two proportions being compared come from paired/matched data on the same subjects rather than independent groups (use McNemar's test in that case).
Formulas and symbols
Two-proportion z-test statistic (pooled)
p-hat = (x1+x2)/(n1+n2) the pooled proportion, correct under H0: p1=p2. Used for the TEST, not the confidence interval.
Risk-difference confidence interval (unpooled)
Uses the UNPOOLED standard error, since estimation does not assume the two proportions are equal, deliberately different from the test statistic's SE.
Cohen's h
The arcsine transform makes h comparable across the whole 0-1 proportion range. Bands: <0.2 negligible, 0.2-0.5 small, 0.5-0.8 medium, >0.8 large.
Assumptions and checks
- Independence of observations. The two-proportion z-test assumes each group's observations are independent (both within and between groups); violating this invalidates the test regardless of the normal-approximation check.
In KernelStats: Not checkable from the data alone: it is a property of how the data were collected.
- When either group's number of successes or failures falls below about 10, the normal approximation to the sampling distribution of the proportion (and its difference) is unreliable, so the reported z, p-value, and confidence interval can be inaccurate.
In KernelStats: Checked directly for each group: the card reports the smaller of successes/failures per group and flags a group as failing the 'Normal approximation' check when either count is below 10; Fisher's exact test and a chi-square test are offered as alternatives that do not rely on this approximation.
Alternatives
- Chi-Square Goodness-of-Fit Test. You want the one-proportion question framed as a goodness-of-fit comparison across two categories rather than a single proportion z-test: in the goodness-of-fit card's Expected shares box, type p0 for the category whose share you are testing and 1 − p0 for the other, each beside its own category name (the form lists the categories alphabetically, so the counted category is not always first); its chi-square then equals the square of this test's z without continuity correction, so the two-sided p-values agree; it takes a column of category labels rather than counts.
- McNemar's Test. The two proportions come from the SAME subjects measured twice (paired data) rather than two independent groups.
Worked example
Scenario
Comparing conversion rates between two ad variants: variant A converts 340 of 5,000 viewers, variant B converts 410 of 5,000 viewers.
Result
z = -2.66, p = .008; risk difference = -1.4 percentage points, 95% CI [-2.4, -0.4]; risk ratio = 0.83; odds ratio = 0.82; Cohen's h = -0.053 (negligible by Cohen's benchmarks).
Interpretation
The difference is statistically significant partly because the sample is very large, and Cohen's h labels it negligible; yet variant B converts about 21% more viewers than A (6.8% versus 8.2%), which could be commercially decisive. The lesson runs both ways: significance does not establish importance, and Cohen's generic benchmarks do not either; judge the 1.4-point difference (CI 0.4 to 2.4 points) against what a point of conversion is worth to the business.
Common misconceptions
Misconception
Using the pooled standard error for both the hypothesis test and the confidence interval would be more consistent.
Correction
Using different standard errors for the test versus the interval is DELIBERATE, correct statistical practice, not an inconsistency to fix. The test assumes H0 (p1=p2 exactly), so pooling gives the correct null-hypothesis standard error; the confidence interval is estimating the ACTUAL difference without assuming the two proportions are equal, so it correctly uses the unpooled standard error instead.
Misconception
The risk ratio and odds ratio are basically interchangeable ways of saying the same thing.
Correction
Risk ratio and odds ratio are close together only when both proportions are SMALL; as the proportions approach 1, the two measures diverge substantially and can tell quite different-sounding stories about the same underlying data. Always check which one is being reported, especially with common outcomes.
Read more: Odds ratio
References
- Probable inference, the law of succession, and statistical inference, Wilson, E. B. (1927), Journal of the American Statistical Association, 22(158), 209-212.
- Interval estimation for the difference between independent proportions: comparison of eleven methods, Newcombe, R. G. (1998), Statistics in Medicine, 17(8), 873-890.
