This Two Proportion Z-Test Calculator helps you compare proportions from two independent groups. For example, you could test if the success rates between two different manufacturing processes differ, or if treatment outcomes vary between two groups. The calculator performs comprehensive statistical analysis including hypothesis testing and generates publication-ready reports. Enter the number of successes and total trials for each group below to begin the analysis. for a quick example.
Two-Proportion Z-Test is used to test if there is a significant difference between two population proportions. It's commonly used when comparing success rates, prevalence, or percentages between two groups.
Test Statistic:
Where:
Confidence Interval:
Testing effectiveness of two different marketing campaigns:
Calculating z-statistic:
Pooled proportion:
Z-statistic:
Confidence Interval:
At 5% significance level, critical value is
and -value = . Since -value , we fail to reject the null hypothesis. There is no significant difference between the two campaigns. We are 95% confident that the true difference in conversion rates is between -3.5% and 23.5%.
Cohen's h measures the difference between two proportions:
Interpretation guidelines:
x <- c(45, 35) # Successes in each group
n <- c(100, 100) # Number of trials in each group
# Perform two-proportion test
result <- prop.test(
x = x,
n = n,
alternative = "two.sided",
correct = FALSE # No continuity correction
)
# Print results
print(result)from statsmodels.stats.proportion import proportions_ztest
import numpy as np
from scipy import stats
# Example data
success1, n1 = 45, 100
success2, n2 = 35, 100
p1 = success1 / n1
p2 = success2 / n2
# Perform two-proportion z-test
zstat, pvalue = proportions_ztest(
[success1, success2], # Number of successes in each group
[n1, n2], # Number of observations in each group
alternative='two-sided',
)
print(f'z-statistic: {zstat:.4f}')
print(f'p-value: {pvalue:.4f}')
# construct confidence interval
alpha = 0.05
z_critical = stats.norm.ppf(1 - alpha / 2)
margin_of_error = z_critical * np.sqrt((p1 * (1 - p1) / n1) + (p2 * (1 - p2) / n2))
prop_diff = p1 - p2
ci_lower = prop_diff - margin_of_error
ci_upper = prop_diff + margin_of_error
print(f'Confidence interval: ({ci_lower:.4f}, {ci_upper:.4f})')Consider these alternatives:
This Two Proportion Z-Test Calculator helps you compare proportions from two independent groups. For example, you could test if the success rates between two different manufacturing processes differ, or if treatment outcomes vary between two groups. The calculator performs comprehensive statistical analysis including hypothesis testing and generates publication-ready reports. Enter the number of successes and total trials for each group below to begin the analysis. for a quick example.
Two-Proportion Z-Test is used to test if there is a significant difference between two population proportions. It's commonly used when comparing success rates, prevalence, or percentages between two groups.
Test Statistic:
Where:
Confidence Interval:
Testing effectiveness of two different marketing campaigns:
Calculating z-statistic:
Pooled proportion:
Z-statistic:
Confidence Interval:
At 5% significance level, critical value is
and -value = . Since -value , we fail to reject the null hypothesis. There is no significant difference between the two campaigns. We are 95% confident that the true difference in conversion rates is between -3.5% and 23.5%.
Cohen's h measures the difference between two proportions:
Interpretation guidelines:
x <- c(45, 35) # Successes in each group
n <- c(100, 100) # Number of trials in each group
# Perform two-proportion test
result <- prop.test(
x = x,
n = n,
alternative = "two.sided",
correct = FALSE # No continuity correction
)
# Print results
print(result)from statsmodels.stats.proportion import proportions_ztest
import numpy as np
from scipy import stats
# Example data
success1, n1 = 45, 100
success2, n2 = 35, 100
p1 = success1 / n1
p2 = success2 / n2
# Perform two-proportion z-test
zstat, pvalue = proportions_ztest(
[success1, success2], # Number of successes in each group
[n1, n2], # Number of observations in each group
alternative='two-sided',
)
print(f'z-statistic: {zstat:.4f}')
print(f'p-value: {pvalue:.4f}')
# construct confidence interval
alpha = 0.05
z_critical = stats.norm.ppf(1 - alpha / 2)
margin_of_error = z_critical * np.sqrt((p1 * (1 - p1) / n1) + (p2 * (1 - p2) / n2))
prop_diff = p1 - p2
ci_lower = prop_diff - margin_of_error
ci_upper = prop_diff + margin_of_error
print(f'Confidence interval: ({ci_lower:.4f}, {ci_upper:.4f})')Consider these alternatives: