Sample Size/Power Calculation by Software/Online Calculators

Sample Size/Power Calculation by Software/Online Calculators

May 24, 2018

Li Zhang, Ph.D.

li.zhang@ucsf.edu Associate Professor Department of Epidemiology and Biostatistics Division of Hematology and Oncology Department of Medicine University of California, San Francisco

Topics

? R packages ? SAS Proc ? Online calculator: CTSI sample size calculator ? Online calculator for clinical trial: SWOG ? Software: G*Power

2

Power Analysis with R



3

Power/Sample size calculation for one or two proportions

? Power calculations for proportion tests (one sample) ? H0: p=p1 vs. Ha: p p1 ? pwr.p.test(h, n, sig.level, power, alternative = c("two.sided","less","greater"))

? Power calculation for two proportions (same sample size) ? H0: p1=p2 vs. Ha: p1 p2 ? pwr.2p.test(h, n, sig.level, power, alternative=c("two.sided","less","greater"))

? Power calculation for two proportions (different sample sizes) ? H0: p1=p2 vs. Ha: p1 p2 ? pwr.2p2n.test(h, n1, n2, sig.level, power, alternative = c("two.sided", "less","greater"))

? Effect size calculation ? R Demo

4

Power calculations for chi-squared tests

pwr.chisq.test(w = NULL, N = NULL, df = NULL, sig.level = 0.05, power = NULL)

? ES.w1(P0, P1):

? Effect size calculation in the chi-squared test for goodness of fit, which is the sum of differences between observed and expected outcome frequencies

? Compute effect size w for two sets of k probabilities P0 (null hypothesis) and P1 (alternative hypothesis)

? ES.w2(P0, P1):

? Effect size calculation in the chi-squared test for association

? Compute effect size w for a two-way probability table corresponding to the alternative hypothesis in the chisquared test of association in two-way contingency tables

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download