How to calculate required sample size in chi-square test, Fisher exact test, Student’s t-test and log-rank test?

Pocket

Sample size calculation may be hard for research member, because it’s difficult to distinguish sample size is enough or not when it was not statistical significant. Required sample size calculation is very important.

χ2 test without correction

To compare survival rate between risk/intervention group and control group, it’s required to execute χ2 test. You can calculate sample size as following formula. With significance level (α) 0.05 (two-tailed) and statistical power (1 – β) 0.8 (one-sided), Zα/2 is 1.96 and Zβ is 0.84, respectively.

\displaystyle N_0 = \frac{\left(Z_{\alpha/2}\sqrt{(1+\phi)\bar{p}(1 - \bar{p})} + Z_\beta\sqrt{\phi p_0(1 - p_0) + p_1(1 - p_1)}\right)^2}{\phi\delta^2} \displaystyle N_1 = \phi N_0

If effect size δ was expressed with odd ratio (OR), sample size could be calculated as formula below.

\displaystyle N_0 = \left(\frac{1 + \phi}{\phi}\right)\frac{(Z_{\alpha/2} + Z_\beta)^2}{(\log{OR})^2\bar{p}(1 - \bar{p})} \displaystyle N_1 = \phi N_0

\displaystyle N_0 : required number of control group.

\displaystyle N_1 : required number of risk/intervention group.

\displaystyle n_0 : actual number of control group.

\displaystyle n_1 : actual number of risk/intervention group.

\displaystyle \phi = \frac{n_1}{n_0}: the ratio of number of risk/intervention group to number of control group.

\displaystyle p_0 : survival rate or efficacy in control group.

\displaystyle p_1 : survival rate or efficacy in risk/intervention group.

\displaystyle \delta = p_1 - p_0 : effect size, difference between two groups.

\displaystyle \bar{p} = \frac{p_0 + \phi p_1}{1 + \phi}

χ2 test with Yates correction and Fisher exact test

When you execute χ2 test with Yates correction or Fisher exact test, you have to correct N0 with multiplying by C, correction term as below.

\displaystyle C = \frac{1}{4}\left(1 + \sqrt{1 + \frac{2 (1 + \phi)}{\phi N_0 |\delta|}}\right)^2

Student’s t-test

In Student’s t-test, you have to calculate standardized effect size (Δ) first with a mean of control group and a mean of risk/intervention group. Then you can calculate sample size with Δ as below. It’s assumed that the variances are equal between control group and risk/intervention group.

\displaystyle \Delta = \frac{|\mu_0 - \mu_1|}{\sigma} \displaystyle N_0 = \left(\frac{1 + \phi}{\phi}\right)\frac{(Z_{\alpha/2} + Z_{\beta})^2}{\Delta^2} + \frac{Z_{\alpha/2}^2}{2(1 + \phi)} \displaystyle N_1 = \phi N_0

log-rank test

In log-rank test, you can calculate required number of event (e) and sample size (N) as following formula. p0 and p1 are cumulative survival rate of control group and risk/intervention group, respectively, derived from previous research or cumulative survival rate after 1 or 2 years from the research started. When φ was 1, it means equal sample size in both groups, it would bring same result as described in How to calculate appropriate sample size in Cox proportional hazard analysis with cross tabulation?.

\displaystyle \theta = \frac{\log(p_1)}{\log(p_0)} \displaystyle e_0 = \frac{1}{(1 + \phi)\phi}\left(\frac{1 + \phi\theta}{1 - \theta}\right)^2(Z_{\alpha/2} + Z_\beta)^2 \displaystyle e_1 = \phi e_0 = \frac{1}{1 + \phi}\left(\frac{1 + \phi\theta}{1 - \theta}\right)^2(Z_{\alpha/2} + Z_\beta)^2 \displaystyle e = e_0 + e_1 = \frac{1}{\phi}\left(\frac{1 + \phi\theta}{1 - \theta}\right)^2(Z_{\alpha/2} + Z_\beta)^2 \displaystyle N_0 = \frac{e}{(1 - p_0) + \phi(1 - p_1)} = \frac{1}{\phi}\left(\frac{1 + \phi\theta}{1 - \theta}\right)^2\frac{(Z_{\alpha/2} + Z_\beta)^2}{(1 - p_0) + \phi(1 - p_1)} \displaystyle N_1 = \phi N_0 \displaystyle N = N_0 + N_1 = \frac{1 + \phi}{\phi}\left(\frac{1 + \phi\theta}{1 - \theta}\right)^2\frac{(Z_{\alpha/2} + Z_\beta)^2}{(1 - p_0) + \phi(1 - p_1)}

\displaystyle N_0 : required number of control group.

\displaystyle N_1 : required number of risk/intervention group.

\displaystyle n_0 : actual number of control group.

\displaystyle n_1 : actual number of risk/intervention group.

\displaystyle \phi = \frac{n_1}{n_0} : the ratio of number of risk/intervention group to number of control group.

\displaystyle p_0 : survival rate or efficacy of control group.

\displaystyle p_1 : survival rate or efficacy of risk/intervention group.

References:
TABLES OF THE NUMBER OF PATIENTS REQUIRED IN CLINICAL TRIALS USING THE LOG RANK TEST

Pocket

投稿者: admin

趣味:写真撮影とデータベース. カメラ:TOYO FIELD, Hasselblad 500C/M, Leica M6. SQL Server 2008 R2, MySQL, Microsoft Access.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です