Two-Sample Proportion Test Calculator
To compare one sample with a hypothesized proportion, use the One-Sample Proportion Test Calculator.
To calculate a Two-Sample Proportion Test, enter the number of events and the total number of trials for each of two independent groups in the table above. Then select both group columns as metric variables.
Load events and trials exampleCalculate a Two-Sample Proportion Test — step by step
- Clear the data table and enter one column per group. Put the group names in the header row.
- Enter the number of events in the first data row and the total number of trials in the second data row. Use whole numbers, with a positive total and an event count between zero and the total.
- Select both columns under Metric Variables. If a column has been assigned a different measurement level, change it to metric. The calculator automatically displays the Two-Sample Proportion Test for two selected metric columns with two values each.
- Choose the alternative hypothesis in the proportion test: the proportions differ, the first is smaller, or the first is larger. The hypotheses and p-values update for your selection.
Example: events and total trials
Load the example above or copy this table into the calculator. It represents 12 events out of 100 trials in Group A and 18 events out of 120 trials in Group B. Enter totals including the events: use 100 and 120, rather than the non-event counts 88 and 102.
| Group A | Group B |
|---|---|
| 12 | 18 |
| 100 | 120 |
Your results
The output includes the observed proportions, their difference (first group minus second group), a two-sided 95% Newcombe–Wilson confidence interval, the pooled two-proportion z-test, and Fisher’s exact test. For small expected counts, follow the warning and use Fisher’s exact test. Unavailable p-values are shown explicitly.
Use this input for two independent groups with a binary outcome (event / non-event). It corresponds to a 2 × 2 table. For more groups or outcome categories, use the Chi-Square Test Calculator.