Tutorials › Group Sequential Methods and Sample Size Re-Estimation › Early-Weighted and Late-Weighted Test Statistics

Non-Proportional Hazards and Delayed Effects · Tutorial 530 of 699

Early-Weighted and Late-Weighted Test Statistics

Learn to calculate and interpret early- and late-weighted logrank statistics, and see why the timing of events can change their conclusions.

Advanced 12 min read

What You'll Learn

  • Define early- and late-weighted logrank statistics using pooled Kaplan–Meier weights.
  • Calculate tied-event score contributions and their variances from risk sets.
  • Compare weighted statistics on the same hypothetical survival data.
  • Interpret the direction and limitations of weighted test results.
  • Identify when weight choice, censoring, or small event counts require caution.

Why Event Timing Changes a Logrank Statistic

The ordinary logrank test gives event-time score contributions equal weight. A weighted logrank test instead multiplies each contribution by a weight determined from the event-time history. If treatment effects are delayed, early events may provide little evidence about the later effect; an early-weighted statistic can then emphasize the period when events are most informative. Conversely, a late-weighted statistic can reduce the influence of early events. The weights change the question the test is sensitive to, not the observed event data.

This tutorial compares two standard choices: a Fleming–Harrington early weight and a Fleming–Harrington late weight. Both are calculated from the pooled Kaplan–Meier estimate just before each event time. The comparison is about how the same data contribute under different prespecified weights; it does not establish that either weighting choice is universally preferable.

Definition: At distinct event time \(t_j\), let \(Y_{1j}\) and \(Y_{0j}\) be the numbers at risk immediately before \(t_j\) in the treatment and control groups, \(Y_j=Y_{1j}+Y_{0j}\), and \(d_j\) the total number of events. Let \(O_{1j}\) be the number of treatment-group events. The logrank score contribution is \(O_{1j}-E_{1j}\), where \(E_{1j}=d_jY_{1j}/Y_j\). For prespecified weights \(w_j\), the weighted score and its null variance are \(U_w=\sum_j w_j(O_{1j}-E_{1j})\) and \(V_w=\sum_j w_j^2V_j\), with \(V_j=Y_{1j}Y_{0j}d_j(Y_j-d_j)/\{Y_j^2(Y_j-1)\}\). The standardized statistic is \(Z_w=U_w/\sqrt{V_w}\).

For the early-weighted statistic, use \(w_{Ej}=\hat S(t_j-)\); for the late-weighted statistic, use \(w_{Lj}=1-\hat S(t_j-)\). Here \(\hat S(t_j-)\) is the pooled Kaplan–Meier survival estimate immediately before \(t_j\), calculated using all participants in both groups. These are the Fleming–Harrington choices with parameters \((1,0)\) and \((0,1)\), respectively. The notation \(t_j-\) matters: the weight uses the event history before the events at \(t_j\), so the current event does not determine its own weight.

Assumptions and Calculation

The usual null interpretation requires that, under \(H_0\), treatment and control event experience is exchangeable within each risk set. In a randomized comparison, this is the no-treatment-effect null, with appropriate handling of any design strata. Censoring must be independent of failure time, at least conditional on factors used in the analysis, so the risk sets remain suitable for comparing event experience. Event times, risk sets, and group assignments must be recorded consistently. The weighted test also requires the weight rule to be specified independently of the observed treatment-group score; choosing weights after seeing which choice gives the smallest p-value invalidates the nominal single-test error rate.

With tied events, the displayed \(E_{1j}\) and \(V_j\) are the conditional mean and variance under the null using the hypergeometric risk-set calculation. The variance is not simply the variance for one event multiplied by \(d_j\): the tied events are sampled without replacement from the risk set. For very small event counts, the standardized statistic may not be well approximated by a standard normal distribution, so its p-value needs an appropriate calibration.

Derivation: Under the null, conditional on \(d_j\) events among \(Y_j\) people at risk, the treatment-group event count has a hypergeometric distribution. Its mean is \(d_jY_{1j}/Y_j\), and its variance is \(V_j\). Thus the score contribution has mean zero and variance \(V_j\). Multiplying that contribution by a fixed, pre-event weight multiplies its variance by \(w_j^2\). Summing the event-time contributions gives \(U_w\) and \(V_w\); the usual large-sample test uses \(Z_w=U_w/\sqrt{V_w}\), approximately standard normal under \(H_0\). The weighting changes the relative contribution of event times, while the squared weights are essential in the variance.

Worked Calculations

Worked Example: An Early Event Receives Different Weights

Consider a hypothetical risk set immediately before the first event time, with 10 treatment participants and 10 control participants at risk. Two participants have events, both in the treatment group. Suppose no earlier events have occurred, so \(\hat S(t-)=1\). The early weight is 1 and the late weight is 0.

The expected treatment events are \(E_1=2(10/20)=1\), so the score contribution is \(O_1-E_1=2-1=1\). Its variance is \(V_1=10(10)(2)(18)/\{20^2(19)\}=3600/7600=0.4737\).

The early-weighted contribution to the score is \(1(1)=1\), and its variance contribution is \(1^2(0.4737)=0.4737\). The late-weighted score contribution and variance contribution are both zero because the late weight is zero at this point. This example isolates the weighting mechanism; it is not, by itself, a complete test.

Worked Example: Comparing Early and Late Weights Across Four Event Times

Suppose a hypothetical trial has the following tied-event risk sets. \(O_1\) is the observed treatment event count. One control participant is censored between the first and second event times; the other risk-set changes follow from the listed events. The table gives \(\hat S(t-)\), the pooled estimate just before each event time.

Time\(Y_1\)\(Y_0\)\(d\)\(O_1\)\(E_1\)\(\hat S(t-)\)
166221.0001.000
245200.88890.8333
343211.14290.6481
432201.2000.4630

The pooled survival values follow from multiplying the preceding estimate by \(1-d_j/Y_j\) after each event time. For example, after time 1 the estimate is \(1(1-2/12)=5/6\), which is the value before time 2. After time 2 it is \((5/6)(1-2/9)=35/54\), the value before time 3. The final pre-event value is \((35/54)(1-2/7)=25/54\).

At each time, calculate the unweighted score contribution and variance. For example, at time 2 the score is \(0-2(4/9)=-8/9\), and \(V_2=4(5)(2)(7)/\{9^2(8)\}=35/81=0.4321\).

Time\(O_1-E_1\)\(V_j\)Early weightLate weight
11.0000.45451.0000
2-0.88890.43210.83330.1667
3-0.14290.40820.64810.3519
4-1.2000.36000.46300.5370

For the early-weighted score, the contributions are \(1(1)+(5/6)(-8/9)+(35/54)(-1/7)+(25/54)(-6/5)=-7/18=-0.3889\). Its variance is the sum of each event-time variance multiplied by the squared early weight: \(V_E=0.4545+(5/6)^2(0.4321)+(35/54)^2(0.4082)+(25/54)^2(0.3600)=1.003\). Therefore \(Z_E=-0.3889/\sqrt{1.003}=-0.3883\).

For the late-weighted score, the first event time contributes zero. The remaining contributions give \(U_L=(1/6)(-8/9)+(19/54)(-1/7)+(29/54)(-6/5)=-59/70=-0.8429\). The variance is \(V_L=(1/6)^2(0.4321)+(19/54)^2(0.4082)+(29/54)^2(0.3600)=0.1664\), so \(Z_L=-0.8429/\sqrt{0.1664}=-2.066\).

For illustration, a two-sided standard-normal approximation gives a p-value of about 0.698 for the early-weighted statistic and about 0.0388 for the late-weighted statistic. Both scores are negative: because the event is an adverse outcome and the treatment group is group 1, the observed score direction is fewer treatment events than expected under the null. This small dataset has only eight events, so the normal-approximation p-value should not be treated as reliably calibrated. The contrast chiefly demonstrates that the late-weighted statistic gives greater relative emphasis to the later negative contributions.

Worked Example: A Later Event-Time Contribution

At a hypothetical later event time, suppose four treatment and six control participants are at risk, two events occur, and neither event is in the treatment group. If the pooled estimate just before this time is \(\hat S(t-)=0.40\), then the early and late weights are \(0.40\) and \(0.60\).

The expected treatment event count is \(2(4/10)=0.8\), giving score contribution \(0-0.8=-0.8\). The variance is \(4(6)(2)(8)/\{10^2(9)\}=384/900=0.4267\). The early-weighted score and variance contributions are \(0.40(-0.8)=-0.32\) and \(0.40^2(0.4267)=0.06827\). The late-weighted values are \(0.60(-0.8)=-0.48\) and \(0.60^2(0.4267)=0.1536\). Thus this event time contributes more to the late-weighted score and variance, although the standardized test statistic depends on contributions from all event times.

Interpreting the Comparison and Checking the Method

The arithmetic shows why a test can be sensitive to when events occur. When pooled survival is high, the early weight is relatively large and the late weight relatively small. As pooled survival falls, the reverse is true. In the four-time example, the earliest observed treatment excess contributes strongly to the early score but not the late score; later control-group event excesses contribute more strongly to the late score. Since the variance is also reweighted, comparing raw scores alone is not enough: compare \(Z_w\) or a properly calibrated p-value.

A negative \(Z_w\) means fewer observed treatment events than expected under the null, after weighting. It does not estimate a constant hazard ratio, nor does it mean that every time period favored treatment. Under non-proportional hazards, a weighted test provides evidence against the null according to its chosen time emphasis; the result should be interpreted alongside the survival curves and the prespecified scientific question.

Useful checks include confirming that risk sets decrease consistently after events and censoring, that tied events are handled with the stated variance, and that each weight uses the pooled history just before its event time. Inspect the per-time weighted score contributions \(w_j(O_{1j}-E_{1j})\) and variance contributions \(w_j^2V_j\). If one time dominates unexpectedly, check the risk-set counts, event coding, and weight calculation. A late weight near zero early in follow-up is intentional, not evidence that the calculation failed.

The ordinary logrank test is the special case \(w_j=1\) at every event time; it does not emphasize early or late events. An early-weighted or late-weighted test is a targeted alternative when the timing pattern of interest was specified in advance. Neither choice solves uncertainty about when effects begin, and selecting whichever weight gives the most favorable result after examining the data needs a method that accounts for that selection. In a group sequential design, the weighted statistic's monitoring boundaries and error rate must also be calibrated for the actual weighted procedure; ordinary logrank boundaries cannot simply be assumed to apply.

Common pitfall: It is incorrect to say that a late-weighted test ignores early events because there were no early events, or to omit the squared weight from its variance. The late weight is zero at the first event time when pooled survival is 1, but later early events can still receive positive weight. For every time point, multiply the score contribution by \(w_j\) and the variance contribution by \(w_j^2\), then sum before standardizing.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. If \(\hat S(t-)=0.75\), what are the early and late weights? Which emphasizes this event time more?
  2. At a tied event time, \(Y_1=5\), \(Y_0=5\), \(d=2\), and \(O_1=0\). Calculate the score contribution before weighting.
  3. Why does the variance contribution use \(w_j^2V_j\), rather than \(w_jV_j\)?
  4. In the four-time example, why is the late-weighted p-value not evidence that the late-weighted test is generally superior?

Solutions. (1) The early weight is \(0.75\) and the late weight is \(0.25\); the early weight is larger. (2) \(E_1=2(5/10)=1\), so \(O_1-E_1=0-1=-1\). (3) Multiplying a random score contribution by \(w_j\) multiplies its variance by \(w_j^2\). (4) The weights emphasize different event times, and the data are hypothetical with few events; the smaller late-weighted p-value reflects this dataset and approximation, not general superiority.

Clinical Biostats