Public Health Voice

Sample Size Calculator

Sample Size Calculator for Comparison Studies

Instructions:
This tool calculates the sample size required for a comparison study between two or more groups (e.g., effectiveness of Drug A vs. Drug B vs. Drug C). Select the number of groups and outcome type, then provide the required parameters:
- Two Groups:
- Continuous Outcome (e.g., blood pressure, weight): Enter the significance level (\(\alpha\)), power, standard deviation (\(\sigma\)), and effect size (\(\Delta\)).
- Binary Outcome (e.g., cured vs. not cured): Enter the significance level (\(\alpha\)), power, proportion in group 1 (\(P_1\)), and proportion in group 2 (\(P_2\)).
- Three or More Groups:
- Comparison of Means (ANOVA): Enter the significance level (\(\alpha\)), power, standard deviation (\(\sigma\)), effect size (\(\delta\)), and number of groups (\(k\)).
- Comparison of Proportions (Chi-square test): Enter the significance level (\(\alpha\)), power, proportions for each group, and number of groups (\(k\)).
- Survival Analysis (Log-rank test, Cox model): Enter the significance level (\(\alpha\)), power, hazard ratio (\(HR\)), proportion of events in each group, and number of groups (\(k\)).
After entering all information, click "Calculate Sample Size" to see the required sample size per group.
Disclaimer: This tool is for informational purposes only and is not a substitute for professional statistical advice. Please consult a statistician for study design and sample size determination.
ConsiderationAdvice

Formulas Used in This Calculator

Comparing Two Means (Continuous Outcome):
\( n = 2 \times \frac{(Z_{\alpha/2} + Z_{\beta})^2 \sigma^2}{\Delta^2} \)
Where \(n\) is the sample size per group, \(Z_{\alpha/2}\) is the critical value for significance level, \(Z_{\beta}\) is the critical value for power, \(\sigma\) is the standard deviation, and \(\Delta\) is the effect size (difference in means).

Comparing Two Proportions (Binary Outcome):
\( n = \frac{\left[ Z_{\alpha/2} \sqrt{2 \bar{P}(1 - \bar{P})} + Z_{\beta} \sqrt{P_1(1 - P_1) + P_2(1 - P_2)} \right]^2}{(P_1 - P_2)^2} \)
Where \(n\) is the sample size per group, \(Z_{\alpha/2}\) and \(Z_{\beta}\) are as above, \(P_1\) and \(P_2\) are the proportions in the two groups, and \(\bar{P} = \frac{P_1 + P_2}{2}\).

Comparison of Means (ANOVA, 3 or more groups):
\( n = \frac{\sigma^2 (Z_{\alpha/2} + Z_{\beta})^2 k}{(k - 1) \delta^2} \)
Where \(n\) is the sample size per group, \(k\) is the number of groups, \(\sigma\) is the standard deviation, \(\delta\) is the minimum detectable difference between group means, and \(Z_{\alpha/2}\) and \(Z_{\beta}\) are as defined above.

Comparison of Proportions (Chi-square test, 3 or more groups):
\( n = \frac{(Z_{\alpha/2} + Z_{\beta})^2 \times \sum P_i (1 - P_i)}{(P_i - P_2)^2} \)
Where \(n\) is the sample size per group, \(P_i\) are the proportions in each group, and other terms are as defined above. (Note: This is an approximation; consult a statistician for precise multi-group chi-square calculations.)

Survival Analysis (Log-rank test, Cox model, 3 or more groups):
\( n = \frac{(Z_{\alpha/2} + Z_{\beta})^2 (HR (1 - P_1) + P_1 (1 - P_2))}{(HR - 1)^2} \)
Where \(n\) is the sample size per group, \(HR\) is the hazard ratio, \(P_1\) and \(P_2\) are proportions of events (for two-group comparison), and other terms are as defined above. (Note: For \(k > 2\), this is simplified; consult a statistician for multi-group survival analysis.)

This tool was developed by PublicHealthVoice by taking references from Lwanga S.K. & Lemeshow S. (1991), WHO, and Charan J. & Biswas T. (2013), Indian J Psychol Med. Learn more.

Also check Sample size calculator for Cross-sectional Study Here


Scroll to Top