Quick viewing(Text Mode)

4. Comparison of Two (K) Samples K=2 Problem: Compare the Survival Distributions Between Two Groups

4. Comparison of Two (K) Samples K=2 Problem: compare the survival distributions between two groups. Ex: comparing treatments on patients with a particular disease. 푍: Treatment indicator, i.e. 푍 = 1 for treatment 1 (new treatment); 푍 = 0 for treatment 0 (standard treatment or placebo) Null Hypothesis:

H0: no treatment (group) difference H0: 푆0 푡 = 푆1 푡 , for 푡 ≥ 0 H0: 휆0 푡 = 휆1 푡 , for 푡 ≥ 0 :

Ha: the survival time for one treatment is stochastically larger or smaller than the survival time for the other treatment.

Ha: 푆1 푡 ≥ 푆0 푡 , for 푡 ≥ 0 with strict inequality for some 푡 (one-sided) Ha: either 푆1 푡 ≥ 푆0 푡 , or 푆0 푡 ≥ 푆1 푡 , for 푡 ≥ 0 with strict inequality for some 푡 Solution: In biomedical applications, it has become common practice to use nonparametric tests; that is, using test whose distribution under the null hypothesis does not depend on specific parametric assumptions on the shape of the . With censored survival , the class of weighted logrank tests are mostly used, with the being the most commonly used. Notations A sample of triplets 푋푖, Δ푖, 푍푖 , 푖 = 1, 2, … , 푛, where 1 푛푒푤 푡푟푒푎푡푚푒푛푡 푋푖 = min(푇푖, 퐶푖) Δ푖 = 퐼 푇푖 ≤ 퐶푖 푍 = ቊ 푖 0 푠푡푎푛푑푎푟푑 푇푟푒푎푡푚푒푛푡

푇푖 = latent failure time; 퐶푖 = latent time

Also, define, 푛

푛1 = number of individuals in group 1 푛푗 = ෍ 퐼(푍푗 = 푗) , 푗 = 0, 1 푛0 = number of individuals in group 0 푖=1 푛 = 푛0 + 푛1 푛 푌1(푥) = number of individuals at risk at time 푥 from trt 1 = σ푖=1 퐼(푋푖 ≥ 푥, 푍푖 = 1) 푛 푌0(푥) = number of individuals at risk at time 푥 from trt 0 = σ푖=1 퐼(푋푖 ≥ 푥, 푍푖 = 0) 푌(푥) = 푌0(푥) + 푌1(푥) 푛 푑푁1(푥) = # of deaths observed at time 푥 from trt 1 = σ푖=1 퐼(푋푖 = 푥, Δ푖 = 1, 푍푖 = 1) 푛 푑푁0(푥) = # of deaths observed at time 푥 from trt 0 = σ푖=1 퐼(푋푖 = 푥, Δ푖 = 1, 푍푖 = 0) 푛 푑푁 푥 = 푑푁0 푥 + 푑푁1 푥 = σ푖=1 퐼(푋푖 = 푥, Δ푖 = 1) Note: 푑푁 푥 actually correspond to the observed number of deaths in time window 푥, 푥 + Δ푥 for some partition of the time axis into intervals of length Δ푥. If the partition is sufficiently fine then thinking of the number of deaths occurring exactly at 푥 or in 푥, 푥 + Δ푥 makes little difference, and in the limit makes no difference at all. Weighted logrank Test 푈(푤) 푇 푤 = 푠푒 푈 푤 Where, 푌 푥 × 푑푁(푥) 푈 푤 = ෍ 푤 푥 푑푁 푥 − 1 1 푌(푥) 푥 푠푒 푈 푤 will be given later.

The null hypothesis of treatment equality will be rejected if 푇 푤 is sufficiently different from zero. Note: 1. At any time 푥 for which there is no observed death 푌 푥 ×푑푁 푥 푑푁 푥 − 1 = 0. 1 푌 푥 This that the sum above is only over distinct failure times. 2. A weighted sum over the distinct failure times of observed number of deaths from treatment 1 minus the expected number of deaths from treatment 1 if the null hypothesis were true. 3. When 푤 푥 = 1, logrank test statistic Motivation Take a slice of time 푥, 푥 + Δ푥 :

The following 2 × 2 table can be formulated:

Under H0:

푑푁1 푥 |푌1 푥 , 푌 푥 , 푑푁 푥 ~퐻푦푝푒푟푔푒표푚푒푡푟푖푐 푌1 푥 , 푑푁 푥 , 푌 푥

푌 푥 푑푁(푥) So, 퐸 푑푁 푥 |푌 푥 , 푌 푥 , 푑푁 푥 = 1 1 1 푌(푥) 푌 푥 ×푑푁(푥) 푑푁 푥 − 1 is the observed number of deaths minus expected number of 1 푌(푥) deaths due to treatment 1. Hence, 푌 푥 ×푑푁(푥) • if H is true, sum of 푑푁 푥 − 1 over 푥 is expected to be near zero. 0 1 푌(푥) • If the hazard rate for treatment 1 were lower than that for treatment 0 consistently 푌 푥 ×푑푁 푥 over 푥, then on average, we expect 푑푁 푥 − 1 to be negative. 1 푌 푥 • If the hazard rate for treatment 1 were higher than that for treatment 0 consistently 푌 푥 ×푑푁 푥 over 푥, then on average, we expect 푑푁 푥 − 1 to be positive. 1 푌 푥 Specifically, the weighted logrank test statistic is given by

푌 푥 × 푑푁(푥) σ 푤 푥 푑푁 푥 − 1 푥 1 푌(푥) 푇 푤 = 푌 푥 푌 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] 1/2 σ 푤2 푥 1 0 푥 푌2 푥 푌 푥 − 1 a Under H0: T(w) ~ N(0, 1)

Therefore, a level 훼 test (two-sided) will reject H0: 푆0 푡 = 푆1 푡 , when

푇 푤 ≥ 푧훼/2 Remarks: 푌 푥 ×푑푁(푥) σ 푑푁 푥 − 1 푥 1 푌(푥) 1. Logrank test stat. = 1/2 σ 푌1 푥 푌0 푥 푑푁 푥 [푌 푥 −푑푁(푥)] 푥 푌2 푥 푌 푥 −1 2. The statistic in the numerator is a weighted sum of observed minus the expected over the 푘 2 × 2 tables, where 푘 is the number of distinct failure times. 3. The weight function 푤 푥 can be used to emphasize differences in the hazard rates over time according to their relative values. For example, if the weight early in time is larger and later becomes smaller, then such test statistic would emphasize early differences in the survival curves. 4. If the weights 푤 푥 are stochastic (functions of data), then they need to be a function of the censoring and survival information prior to time 푥. 5. 푤 푥 = 1: Logrank test 6. 푤 푥 = 푌(푥): Gehan′s generalization of wilcoxon test 7. 푤 푥 = 퐾푀(푥): Peto−Prentice′s generalization of wilcoxon test

Note: Since both 푌(푥) and 퐾푀(푥) are non-increasing functions of 푥, both Gehan′s and Peto−Prentice′s tests emphasize the difference early in the survival curves. A Heuristic Proof Define a set of random variables:

퐹 푥 = 푑푁0 푢 , 푑푁1 푢 , 푌1 푢 , 푌0 푢 , 푤1 푢 , 푤0 푢 , 푑푁 푥 for all grid points 푢 < 푥

Assume H0 is true. Knowing 퐹 푥 would imply (with respect to the 2 × 2 table) that:

We know 푌1 푥 , 푌0 푥 (i.e., the number at risk at time 푥 from either treatment group), and, in addition, we know 푑푁 푥 (i.e., the number of deaths – total from both treatment groups – occurring in 푥, 푥 + Δ푥 ). The only thing we don't know is 푑푁1 푥 . Conditional on 퐹 푥 , we have a 2 × 2 table, which under the null hypothesis follows independence, and we have the knowledge of the marginal counts of the table (i.e., the marginal count are fixed conditional on 퐹 푥 ). Therefore, the conditional distribution of one of the counts, say, 푑푁1 푥 , in the cell of the table, given 퐹 푥 follows a hypergeometric distribution. 푑푁(푥) 푌 푥 −푑푁(푥) 푐 푌 푥 −푐 푃 푑푁 푥 = 푐|푌 푥 , 푌 푥 , 푑푁 푥 = 1 1 1 푌(푥) 푌 푥 푌 푥 푑푁(푥) 1 퐸 푑푁 푥 |퐹 푥 = 1 1 푌(푥)

푌 푥 푌 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] 푉푎푟 푑푁 푥 |퐹 푥 = 1 0 1 푌2 푥 푌 푥 − 1 The numerator of the weighted logrank test statistic is: 푌 푥 × 푑푁(푥) 푈 푤 = ෍ 푤 푥 푑푁 푥 − 1 1 푌(푥) 푥

Notice that under H0 : 푌 푥 × 푑푁(푥) 퐸 푈 푤 = ෍ 퐸 푤 푥 푑푁 푥 − 1 1 푌(푥) 푥 푌 푥 × 푑푁(푥) = ෍ 퐸 퐸 푤 푥 푑푁 푥 − 1 퐹(푥) 1 푌(푥) 푥 푌 푥 × 푑푁(푥) = ෍ 퐸 푤 푥 퐸 푑푁 푥 퐹(푥) − 1 = 0 1 푌(푥) 푥

Next, we will find an unbiased estimator for the of 푈 푤 . Let 푌 푥 × 푑푁(푥) 퐴 푥 = 푤 푥 푑푁 푥 − 1 . 1 푌(푥) Then,

푉푎푟 푈 푤 = 푉푎푟 ෍ 퐴(푥) = ෍ 푉푎푟 퐴 푥 + ෍ 퐶표푣 퐴 푥 , 퐴 푦 . 푥 푥 푥≠푦 Notice that we already show: 퐸 퐴 푥 = 퐸 퐴 푦 = 0. WOLG, suppose y < 푥, then, 퐶표푣 퐴 푥 , 퐴 푦 = 퐸 퐴 푥 ∗ 퐴(푦) = 퐸 퐸 퐴 푥 ∗ 퐴(푦) 퐹(푥) = 퐸 퐴 푦 퐸 퐴(푥) 퐹(푥) = 0

Now, 푉푎푟 푈 푤 = ෍ 푉푎푟 퐴 푥 = ෍ 퐸 퐴2 푥 = ෍ 퐸 퐸 퐴2 푥 퐹(푥) 푥 푥 푥 푌 푥 × 푑푁(푥) 2 = ෍ 퐸 퐸 푤2 푥 푑푁 푥 − 1 퐹(푥) 1 푌(푥) 푥 2 2 = ෍ 퐸 푤 푥 퐸 푑푁1 푥 − 퐸 푑푁1 푥 퐹(푥) 푥 2 = ෍ 퐸 푤 푥 푉푎푟 푑푁1 푥 퐹(푥) 푥 푌 푥 푌 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] = ෍ 퐸 푤2 푥 1 0 푌2 푥 푌 푥 − 1 푥 This means:

푌1 푥 푌0 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] ෍ 푤2 푥 푉푎푟 푈 푤 푌2 푥 푌 푥 − 1 is an unbiased estimator for . 푥 Recapping:

Under H0 : 푆0 푡 = 푆1 푡

1. The Statistics 푈 푤 = σ푥 퐴(푥) has expectation equal to zero, i.e. E 푈 푤 = 0.

2. 푈 푤 = σ푥 퐴(푥) is made up of a sum of conditionally uncorrelated terms each with zero. By the central limit theory for such martingale structures, U(w) properly normalized will be approximately a standard normal . That is: 푈(푤) a 푇 푤 = N(0, 1) 푠푒 푈 푤 ~ 3. An unbiased estimate of the variance of 푈 푤 was given by 푌 푥 푌 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] ෍ 푤2 푥 1 0 푌2 푥 푌 푥 − 1 푥

Therefore, 푌 푥 × 푑푁(푥) σ 푤 푥 푑푁 푥 − 1 푈(푤) 푥 1 푌(푥) a 푇 푤 = N(0, 1) 푠푒 푈 푤 푌 푥 푌 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] 1/2 ~ σ 푤2 푥 1 0 푥 푌2 푥 푌 푥 − 1 # An Example

The data give the survival times for 25 myelomatosis patients randomized to two treatments (1 or 2): dur status trt renal 8 1 1 1 180 1 2 0 … 1296 1 2 0 dur is the patient's survival or censored time, status is the censoring indicator, trt is the treatment indicator, renal is the indicator of impaired renal function (0 = normal; 1 =impaired).

To test the null hypothesis the treatment trt has no effect, i.e. H0 : 푆0 푡 = 푆1 푡

SAS & R codes Note: 1. the numerator of Gehan's Wilcoxon test is much larger than that of logrank test since Gehan's Wilcoxon test uses the number at risk as the weight and logrank test uses identity weight. 2. The likelihood ratio test is based on exponential model. 3. In this example, logrank test gives a more significant result than Gehan's Wilcoxon test (although none of them provides strong evidence against the null hypothesis). Why is that?

The treatment specific Kaplan-Meier survival estimates were generated using the following R functions:

pdf(file="fig_myel.pdf", horizontal = F, height=6, width=8.5, pointsize=14) # par(mfrow=c(1,2)) example <- read.table(file="chap4_myel.txt", header=T); fit <- survfit(Surv(dur, status) ~ trt, example); plot(fit, xlab="Patient time (months)", ylab="survival probability", lty=c(1,2)) legend(1000,1, c("trt = 1", "trt = 2"), lty=c(1,2), cex=0.8) dev.off() Kaplan-Meier estimates for two treatments

> survdiff(Surv(dur, status) ~ trt, example) logrank test in R Call: survdiff(formula = Surv(dur, status) ~ trt, data = example) N Observed Expected (O-E)^2/E (O-E)^2/V trt=1 12 6 8.34 0.655 1.31 trt=2 13 11 8.66 0.631 1.31 Chisq= 1.3 on 1 degrees of freedom, p= 0.252 > survdiff(Surv(dur, status) ~ trt, rho=1, example) Peto-Prentice's Wilcoxon N Observed Expected (O-E)^2/E (O-E)^2/V test trt=1 12 4.80 5.60 0.115 0.304 trt=2 13 6.83 6.03 0.106 0.304 Chisq= 0.3 on 1 degrees of freedom, p= 0.581 Power and Sample Size Since a survival curve is infinite dimensional, describing departures from the null as differences at every point in time over the survival curve would be complicated. Clearly, some simplifying conditions must be given. In clinical trials, proportional hazards alternatives have become very popular. That is, 휆 푡 1 = exp 훽 , for all 푡 ≥ 0 휆0 푡 .(β > 0֜ individuals on treatment 1 have worse survival (i.e., die faster .1 (β = 0֜ no treatment difference (null is true .2 .(β < 0֜ individuals on treatment 1 have better survival (i.e., live longer .3 휆 푡 푑푙표푔 푆 푡 푑푙표푔 푆 푡 (exp 훽 ֞− 1 = − 0 exp(훽 = 1 휆0 푡 푑푡 푑푡

(푙표푔 푆1 푡 = 푙표푔 푆0 푡 exp 훽 + C (t = 0֜C = 0֞ 훾 푆1 푡 = 푆0 푡 , 훾 = exp 훽֞ log −푙표푔 푆1 푡 = log −푙표푔 푆0 푡 + 훽֞ Based on the last equation, by plotting estimated survival curves (say, Kaplan-Meier estimates) for two treatments (groups) on a log[-log] scale, we would see constant vertical shift of the two curves if the hazards are proportional. EX:

Note: Do not be misled by the visual impression of the curves near the origin. For the specific case where the survival curves for the two groups are exponentially distributed, (i.e., constant hazard), we automatically have proportional hazards, since 휆 푡 휆 1 = 1 , for all 푡 ≥ 0 휆0 푡 휆0 The ratio of 푚 or mean 휇 survival times for two groups having exponential distributions is 푚 log 2 /휆 휆 1/휆 휇 1 = 1 = 0 = 1 = 1 푚0 log 2 /휆0 휆1 1/휆0 휇0 logrank Test & Proportional Hazards The logrank test is the most powerful test among the weighted logrank tests to detect proportional hazards alternatives. In fact, it is the most powerful test among all nonparametric tests for detecting proportional hazards alternatives. Therefore, the proportional hazards alternative has not only a nice interpretation but also nice statistical properties. These features leads to the natural use of logrank tests (unweighted) .

휆1 푡 For 퐻푎: = exp 훽퐴 ; 훽퐴 ≠ 0, When censoring does not depend on treatment 휆0 푡 (e.g., randomized ), the logrank test has distribution approximated by

푇 a 푛 ~ 푁 훽퐴 푑휃 1 − 휃 , 1

where 푑 is the total number of deaths (events), 휃 is the proportion in group 1, 훽퐴 is the log under the alternative.

푇 a Let 휇 = 훽퐴 푑휃 1 − 휃 푛 ~ 푁 휇, 1 Sample Size Formula

Recall that our test procedure is that: Reject 퐻0 when 푇푛 > 푧훼/2 a a under 퐻0, 푇푛 ~ 푁 0,1 and under 퐻푎, 푇푛 ~ 푁 휇, 1 By the definition of power, we have

푃 푇푛 > 푧훼/2 퐻푎 = 1 − 훾 (1 − 훾) is the desired power.

푃 푇푛 > 푧훼/2 퐻푎 + 푃 푇푛 < −푧훼/2 퐻푎 = 1 − 훾 ֞

Assume 훽퐴 > 0, then 휇 > 0. In this case,

푃 푇푛 < −푧훼/2 퐻푎 = 푃 푇푛 − 휇 < −푧훼/2 − 휇 퐻푎 = 푃 푍 < −푧훼/2 − 휇 = 푃 푍 > 푧훼/2 + 휇 ≈ 0 푍~푁(0,1)

푃 푇푛 > 푧훼/2 퐻푎 = 푃 푇푛 − 휇 < 푧훼/2 − 휇 퐻푎 = 푃 푍 > 푧훼/2 − 휇

푃 푍 > 푧훼/2 − 휇 ≈ 1 − 훾 ֞ 푃 푍 < 푧훼/2 − 휇 ≈ 훾֞ 푃 푍 > −푧훼/2 + 휇 ≈ 훾

2 푧훾 + 푧훼/2 푧훼/2 + 휇 = 푧훾 ֞ 휇 = 푧훾 + 푧훼/2 ֞ 훽퐴 푑휃 1 − 휃 = 푧훾 + 푧훼/2 ֞ 푑 = 2− ( 훽퐴) ∗휃 1−휃

• Exactly the same formula for 푑 can be derived if 훽퐴< 0. • 푑 acts as the sample size. Take a two-sided logrank test with level 훼 = 0.05, power 1 − 훾 = 0.90, 휃 = 0.5. Then 4 1.96 + 1.28 2 푑 = 2 ( 훽퐴) The following table gives some required number of events for different hazard ratio exp 훽퐴 . Hazard ratio exp 훽퐴 푑 2.00 88 1.50 256 1.25 844 1.10 4623

EX: Suppose patients with advanced lung cancer have a median survival time of 6 months. We have a new treatment which we hope will increase the median survival time to 9 months. If the survival time follows exponential distributions, then this 휆1 푡 휆1 푚0 6 2 difference would correspond to a hazard ratio of exp 훽퐴 = = = = = . 휆0 푡 휆0 푚1 9 3 4 1.96 + 1.28 2 푑 = = 256 (log 2/3 )2 One strategy is to enter some larger number of patients, say 350 patients (about 175 patients on each treatment arm) and then continue following until we have 256 deaths. Design Specification

More often in survival studies we need to be able to specify to the investigators the following: 1. number of patients; 2. accrual period; 3. follow-up time. It was shown by Schoenfeld that reasonable approximations for obtaining the desired power can be made by ensuring that the total expected number of deaths (events) from both groups, computed under the alternative, should equal (assuming equal probability of assigning treatments) 2 4 푧훾 + 푧훼/2 퐸 푑 = 2 ( 훽퐴)

That is, we compute the expected number of deaths for both groups “0” and “1” separately under the alternative hypothesis, the sum of these should be equal to the above formula. Computing 퐸 푑 in One Sample

Suppose (푋푖, Δ푖), 푖 = 1, … , 푛 represents a sample of possibly censored survival data, with 푋푖 = min(푇푖, 퐶푖), Δ푖 = 퐼 푇푖 ≤ 퐶푖 , and the following notations: 푇 퐶 푓(푡) Density function 푔(푡) 퐹(푡) C.D.F 퐺(푡) 푆(푡) 퐻(푡) 휆(푡) Hazard function 휇(푡)

The expected number of deaths is ∞ ∞ 퐸 푑 = 푛 ∗ 푃 Δ = 1 = න 푓 푥, Δ = 1 푑푥 = න 푓 푥 퐻 푥 푑푥 0 0 Ex: Suppose 푇 is exponential with hazard 휆 ¸ and 퐶 is exponential with hazard 휇,

then ∞ 푃 Δ = 1 = න 푓 푥 퐻 푥 푑푥 0 ∞ 휆 = න 휆푒−휆푥푒−휇푥푑푥 = 0 휆 + 휇 Design with Censoring Due To Staggered Entry

Suppose 푛 patients enter the study at times 퐸1, 퐸2, … , 퐸푛 assumed to be independent and identically distributed (i.i.d.) with distribution function 푄퐸 푢 = 푃[퐸 ≤ 푢]. If there was no other loss to follow-up or competing risk, the censoring random variable would be 퐶 = 퐿 − 퐸. Hence,

퐻퐶 푢 = 푃 퐿 − 퐸 ≥ 푢 = 푃 퐸 ≤ 퐿 − 푢 = 푄퐸 퐿 − 푢 , 푢 ∈ 0, 퐿 . Therefore, for such an , the expected number of deaths in a sample of size 푛 would be equal to 퐿 푛 ∗ 푃 Δ = 1 = න 휆푇푢 푆푇 푢 푄퐸(퐿 − 푢)푑푢 0 Ex: Suppose the underlying survival of a population follows an . A study will accrue patients for 퐴 years uniformly during that time and then analysis will be conducted after an additional 퐹 years of follow-up. What is the expected number of deaths for a sample of 푛 patients. The entry rate follows a uniform distribution in 0, 퐴 . That is 0 푖푓 푢 ≤ 0 푢 푄 푢 = 푃 퐸 ≤ 푢 = 푖푓 0 < 푢 < 퐴 퐸 퐴 1 푖푓 푢 > 퐴 Consequently, 1 푖푓 푢 ≤ 퐿 − 퐴 퐿−푢 퐻 푢 = 푄 퐿 − 푢 = 푖푓 퐿 − 퐴 < 푢 ≤ 퐿 퐶 퐸 퐴 0 푖푓 푢 > 퐿 퐿 Hence, 푃 Δ = 1 = න 휆푇푢 푆푇 푢 퐻퐶 푢 푑푢 0 퐿−퐴 퐿 퐿 − 푢 = න 휆푒−휆푢푑푢 + න 휆푒−휆푢 푑푢 0 퐿−퐴 퐴 퐿−퐴 퐿 퐿 1 퐿 = න 휆푒−휆푢푑푢 + න 휆푒−휆푢푑푢 − න 푢푒−휆푢푑푢 0 퐴 퐿−퐴 퐴 퐿−퐴 = ⋯ 푒−휆퐿 = 1 − 푒휆퐴 − 1 휆퐴 Therefore, if we accrue 푛 patients uniformly over 퐴 years, who fail according to an exponential distribution with hazard ¸, and follow them for an additional 퐹 years, then the 푒−휆퐿 expected number of deaths in the sample is 푛 ∗ 1 − 푒휆퐴 − 1 휆퐴 Lung cancer example (continued) log 2 log 2 푚0 = 4 푦푒푎푟푠; 휆0 = = 0.173; 푚1 = 6 푦푒푎푟푠; 휆0 = = 0.116; 푚0 푚1 4 1.96 + 1.28 2 푑 = = 256 (log 2/3 )2 Suppose we decide to accrue patients for 퐴 = 5 years and then follow them for an additional 퐹 = 3 years, so L = 퐴 + 퐹 = 8 years. How large a sample size is necessary? In a randomized trial where we randomize the patients to the two treatments with equal probability, the expected number of deaths would be equal to 퐷1 + 퐷0, where 푛 푒−휆푗퐿 휆푗퐴 퐷푗 = ∗ 1 − 푒 − 1 , 푗 = 0,1 2 휆푗퐴 For this problem, the expected number of deaths is 푛 푒−0.173∗8 푛 푒−0.116∗8 퐷 + 퐷 = ∗ 1 − 푒0.173∗5 − 1 + ∗ 1 − 푒0.116∗5 − 1 1 0 2 0.173 ∗ 5 2 0.116 ∗ 5 푛 푛 푛 = ∗ 0.6017 + ∗ 0.4642 = ∗ 1.0658 2 2 2 Thus if we want the expected number of deaths to equal 256, then 푛 푛 = 480 ֞ 256 = 1.0658 ∗ 2 Note:

1. Different combinations of sample sizes, accrual periods and follow-up periods can be experimented to give the desired answer and best suits the needs of the experiment being conducted. 2. The above calculation for the sample size requires that we are able to get 푛 = 480 patients within 퐴 = 5 years. If this is not the case, we will be underpowered to detect the difference of interest. 3. the sample size 푛 and the accrual period 퐴 are tied by the accrual rate 푅 (number of patients available per year) by 푛 = 퐴푅. If we have information on R, the above calculation has to be modified. 4. Other issues that affect power and may have to be considered are: a). loss to follow-up; b). competing risks; c). non-compliance. 5. Originally, we introduced a class of weighted logrank tests to test H0: S1 t = S0 t , for t ≥ 0. The weighted logrank test with weight function w(t) is optimal to detect the following alternative hypothesis

훽푤(푡) 휆1 푡 휆1 푡 = 휆0 푡 푒 or log = 훽푤 푡 ; 훽 ≠ 0 휆0 푡 퐾 sample weighted logrank test Testing the null hypothesis that the survival distributions are the same for 퐾 > 2 groups.

Notations: A sample of triplets 푋푖, Δ푖, 푍푖 , 푖 = 1, 2, … , 푛, where

푋푖 = min(푇푖, 퐶푖) Δ푖 = 퐼 푇푖 ≤ 퐶푖

푍푖 = {1,2, … , 퐾} corresponding to group membership in one of the 퐾 groups

Denote 푆푗 푡 = 푃 푇푗 ≥ 푡 as the survival function for the 푗th group. The null hypothesis can then be represented as:

H0: 푆1 푡 = 푆2 푡 = ⋯ = 푆퐾 푡 , for 푡 ≥ 0, or equivalently H0: 휆1 푡 = 휆2 푡 = ⋯ = 휆퐾 푡 , for 푡 ≥ 0

푑푁푗(푥) = # of deaths observed at time 푥 ([푥 + Δ푥)) from group 푗 = 1,2, … , 퐾

푌푗(푥) = # at risk at time 푥 from group 푗 퐾 푑푁 푥 = σ푗=1 푑푁푗 푥 , total # of observed deaths at time 푥 퐾 푌 푥 = σ푗=1 푌푗 푥 , total # at risk at time 푥

퐹 푥 = 푑푁푗 푢 , 푌푗 푥 ; 푗 = 1,2, … , 퐾 for all grid points 푢 < 푥, 푎푛푑 푑푁(푥) At a slice of time[푥 + Δ푥), the data can be viewed as a 2 × 퐾 :

Conditioning on 퐹(푥), we know the marginal counts of this 2 × 퐾 table, in which case the T vector 푑푁1 푥 , 푑푁2 푥 , … , 푑푁퐾 푥 is distributed as a multivariate version of a hypergeometric distribution. Particularly,

푌푗 푥 푑푁(푥) 퐸 푑푁 푥 |퐹 푥 = , 푗 = 1,2, … , 퐾 푗 푌(푥)

푌푗 푥 푌 푥 − 푌푗 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] 푉푎푟 푑푁 푥 |퐹 푥 = 푗 푌2 푥 푌 푥 − 1

푌푗 푥 푌푗′ 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] Cov 푑푁 푥 , 푑푁 ′ 푥 |퐹 푥 = − 푗 푗 푌2 푥 푌 푥 − 1 Consider a 퐾 − 1 dimensional vector 푈 푤 , made up by the weighted sum of observed number of deaths minus their expected number of deaths for each treatment group 푗 = 1,2, … , 퐾, summer over 푥 푑푁 푥 σ 푤 푥 푑푁 푥 − 푌 푥 ∗ 푥 1 1 푌(푥) 푑푁 푥 σ푥 푤 푥 푑푁2 푥 − 푌2 푥 ∗ 푈 푤 = 푌(푥) ⋮ 푑푁 푥 ෍ 푤 푥 푑푁 푥 − 푌 푥 ∗ 퐾−1 퐾−1 푌(푥) 푥 Note: 1. The 퐾 − 1 dimensional vector is considered here since the sum of all 퐾 elements is equal to zero and hence we have redundancy. If we included all 퐾 elements then the resulting vector would have a singular variance matrix. 2. Using arguments similar to the two-sample test, it can be shown that the vector of observed minus expected counts computed at different times, 푥 and 푥′ are uncorrelated. Consequently, the corresponding 퐾 − 1 × 퐾 − 1 matrix ′ of the vector 푇푛(푤) is given by 푉 = 푉푗푗′ , 푗, 푗 = 1,2, … , 퐾 − 1, where

푌푗 푥 푌 푥 − 푌푗 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] 푉 = ෍ 푤2 푥 푗푗 푌2 푥 푌 푥 − 1 푥

푌 푥 푌 ′ 푥 푑푁 푥 [푌 푥 − 푑푁(푥)] 2 푗 푗 푉 ′ = − ෍ 푤 푥 푗푗 푌2 푥 푌 푥 − 1 푥 Test Statistic: 푲 sample weighted logrank test

The test statistic used to test the null hypothesis is given by the quadratic form 푇 푤 = 푈 푤 푇푉−1푈 푤

Note: This statistic would be numerically identical regardless which of the 퐾 − 1 groups were included to avoid redundancy.

2 Under 퐻0, this is distributed asymptotically as a 휒 distribution with 퐾 − 1 degrees of freedom. Hence, a level 훼 test would reject the null hypothesis whenever

푇 −1 2 푇 푤 = 푈 푤 푉 푈 푤 ≥ 휒훼;퐾−1, 2 2 2 Where 휒훼;퐾−1 is the quantity that satisfies P 휒퐾−1 ≥ 휒훼;퐾−1 = 훼

Remark: 1. As with the two-sample tests, if the weight function 푤(푥) is stochastic, then it must be a function of the survival and censoring data prior to time 푥. 2. The most popular test was a weight 푤 푥 ≡ 1 and is referred to as the 퐾 −sample logrank test. These tests are available on most major software packages such as SAS, S+, etc. For example, the SAS code is exactly the same the that for two sample tests. Stratified Test: Do We Need it? • When comparing survival distributions among groups, especially in non-randomized studies, effect, i.e., other factors that may affect the interpretation of the relationship between survival and groups, is a concern. • For example, suppose we extract hospital records for patients who were treated after a myocardial infarction (heart attack) with either bypass surgery or angioplasty, and wish to test whether or not there is a difference in the survival distributions between these treatments. If we believe that these two groups of patients are comparable, a logrank or weighted logrank test can be used. • However, since this study was not randomized, there is no guarantee that the patients being compared are prognostically similar, e.g., it may be that the group of patients receiving angioplasty are younger on average or prognostically better in other ways. Then we wouldn't know whether significant difference in treatment groups, if they occurred, were due to treatment or other prognostic factors. • Or the treatments do have different effects. But the difference was blocked by some other factors the were distributed unbalancedly between treatment groups. • The effect of these prognostic factors can be adjusted either through stratification or through regression modeling (discussed later . • To adjust by stratification, strata of our population were definde according to combination of factors which make individuals within each strata more prognostically similar. Comparisons of survival distribution between groups are made within each strata and then these results are combined across the strata. Stratified logrank Test Consider a population being sampled as consisting of p strata. The strata, for example, could be those used in balanced of a , or combination of factors that make individuals within each strata prognostically similar. Consider two- sample comparisons (treatments 0 vs. 1), and let 푗 index the strata 푗 = 1,2, … , 푝. The null hypothesis being tested in a stratified test is

H0: 푆1푗 푡 = 푆0푗 푡 , for 푡 ≥ 0, 푗 = 1,2, … , 푝 The stratified logrank test consists of computing two-sample test statistic within each strata and then combining these results across strata. For example,

푝 푑푁푗 푥 ∗ 푌1푗 푥 ] σ푗=1 σ푥 푤푗 푥 푑푁1푗 푥 − 푌푗 푥 푇 푤 = 1/2 푝 2 푌1푗 푥 푌0푗 푥 푑푁푗 푥 [푌푗 푥 − 푑푁푗(푥)] σ푗=1 σ푥 푤푗 푥 2 푌푗 푥 푌푗 푥 − 1 Since within each of the strata there was no additional balance being forced between two groups beyond chance, the mean and variance of the test statistics computed within strata under the null hypothesis, are correct. The combining of the statistics and their over independent strata is now also correct. The resulting stratified logrank test has a standard normal distribution (asymptotically) under 퐻0, i.e., a a 2 푇(푤)~ 푁 0,1 or 푇(푤) 2 ~ 휒1 Remarks: • Stratified tests can be constructed for 퐾samples as well. We just add the vector of test statistics over strata, as well as the covariance matrices before you compute the quadratic form leading to the 휒2 statistic with (퐾 − 1)degrees of freedom. • Sample size consideration are similar to the unstratified tests. Power is dependent on the number of observed deaths and the hazard ratio between groups within strata. For example, the stratified logrank test with 푤(푥) ≡ 1 for all 푥 and 푗, is most powerful to detect proportional hazards alternatives within strata, where the hazard ratio is also assumed constant between strata. Namely

Ha: 휆1푗 푥 = 휆0푗 푥 exp(훽퐴) The number of deaths total in the study necessary to obtain power 1 − 훾 for detecting a difference corresponding to 훽퐴 above, using a stratified logrank test at the 훼 level of significance (two-sided), is equal to 2 4 ∗ 푧훼 + 푧1−훾 푑 = 2 훽퐴 This assumes equal randomization to the two treatments and is the same value as that obtained for unstratified tests. To compute the expected number of deaths using the design stage, we must compute separately over treatments and strata and these should add up to the desired number above. SAS Example