Formula Used
Sample proportions: p1 = x1 / n1 and p2 = x2 / n2.
Observed difference: d = p1 - p2.
Pooled proportion: pc = (x1 + x2) / (n1 + n2).
Pooled standard error: SE = sqrt(pc(1 - pc)(1 / n1 + 1 / n2)).
Z statistic: z = ((p1 - p2) - d0) / SE.
Fisher exact probability: C(x1 + x2, k)C(f1 + f2, n1 - k) / C(n1 + n2, n1).
Wald interval: (p1 - p2) ± zcrit × sqrt(p1(1 - p1) / n1 + p2(1 - p2) / n2).
Risk ratio: RR = p1 / p2. Odds ratio: OR = (x1 × f2) / (x2 × f1).
How to Use This Calculator
Enter successes and total trials for both independent groups.
Select the alternative hypothesis that matches your study question.
Choose pooled or unpooled standard error for the z test.
Set the confidence level and alpha for reporting.
Submit the form and review the exact p-value first.
Use the CSV or PDF buttons to save results.
Two Sample Binomial Test Guide
A two sample binomial test compares success rates from two independent groups. It is useful when each observation has only two outcomes. Examples include pass or fail, click or no click, cured or not cured, and defect or no defect. The calculator accepts successes and total trials for both groups. It then estimates proportions, difference, risk ratio, odds ratio, confidence intervals, and hypothesis test results.
Why This Test Matters
Simple percentage differences can be misleading. A small study may show a large gap by chance. A large study may show a small gap with strong evidence. This tool adds statistical context. It reports both exact and approximate evidence. The Fisher exact method is reliable for small counts. The z method is fast and familiar for larger samples.
Choosing Inputs
Use Group 1 for the treatment, variant, or exposed group. Use Group 2 for the control or reference group. Enter total trials, not failures. The calculator finds failures automatically. Select a two sided test when any difference matters. Select a greater test when Group 1 is expected to be higher. Select a less test when Group 1 is expected to be lower.
Interpreting Results
The p value measures how unusual the observed data would be under the null claim. A smaller p value gives stronger evidence against that claim. The confidence interval shows a plausible range for the true difference. If a two sided interval excludes zero, the groups differ at the selected confidence level. Effect sizes help practical decisions. A risk ratio above one means Group 1 has a higher success rate. An odds ratio above one points in the same direction.
Best Practices
Check sample independence before using the calculator. Avoid mixing repeated measures with independent samples. Review expected counts when using the z test. Prefer exact results when counts are low or proportions are near zero or one. Report the method, alternative hypothesis, confidence level, and sample counts. Save the CSV or PDF output for audits, reports, and reproducible records. When results disagree, explain the reason. Exact tests condition on margins, while z tests use normal approximation. The interval describes effect size, not only significance. Practical importance should always guide the final decision.
FAQs
What is a two sample binomial test?
It compares two independent success rates. Each group must have a count of successes and total trials. The test checks whether the observed difference is larger than expected by random sampling variation.
When should I use Fisher exact results?
Use Fisher exact results when sample sizes are small, expected counts are low, or proportions are near zero or one. It does not rely on the normal approximation.
When is the z test useful?
The z test is useful for larger independent samples. It is quick and familiar. It works best when both groups have enough successes and failures.
What does a two sided alternative mean?
It means either group could have the higher true success rate. Use it when you want to detect any difference, not only one planned direction.
What is the risk ratio?
The risk ratio divides the first group proportion by the second group proportion. A value above one means Group 1 has a higher observed success rate.
What is the odds ratio?
The odds ratio compares success odds between groups. It is common in case control work and logistic models. It can look larger than the risk ratio.
What does the confidence interval show?
It shows a plausible range for the true difference in success rates. Wide intervals suggest uncertainty. Intervals near zero suggest weaker practical separation.
Can I export the result?
Yes. After calculating, use the CSV button for spreadsheet records. Use the PDF button for a simple printable report.