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.
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.
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-)\) |
|---|---|---|---|---|---|---|
| 1 | 6 | 6 | 2 | 2 | 1.000 | 1.000 |
| 2 | 4 | 5 | 2 | 0 | 0.8889 | 0.8333 |
| 3 | 4 | 3 | 2 | 1 | 1.1429 | 0.6481 |
| 4 | 3 | 2 | 2 | 0 | 1.200 | 0.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 weight | Late weight |
|---|---|---|---|---|
| 1 | 1.000 | 0.4545 | 1.000 | 0 |
| 2 | -0.8889 | 0.4321 | 0.8333 | 0.1667 |
| 3 | -0.1429 | 0.4082 | 0.6481 | 0.3519 |
| 4 | -1.200 | 0.3600 | 0.4630 | 0.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.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- If \(\hat S(t-)=0.75\), what are the early and late weights? Which emphasizes this event time more?
- At a tied event time, \(Y_1=5\), \(Y_0=5\), \(d=2\), and \(O_1=0\). Calculate the score contribution before weighting.
- Why does the variance contribution use \(w_j^2V_j\), rather than \(w_jV_j\)?
- 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.