Why Derive the Score?
The ordinary logrank test compares the observed number of treatment events with the number expected from the treatment fraction in each risk set. A weighted logrank test makes the same comparison but multiplies each event-time contribution by a prespecified or history-based weight. This changes how strongly different event times contribute to the total score; it does not change the need to construct the risk sets correctly.
The derivation matters especially when treatment effects may change over time. A weighted score is only useful if its expected value and variance under the null are understood. The key condition is that the weight at an event time is predictable: it can depend on time and information available just before that event time, but not on the event outcomes occurring at that time.
Risk sets are determined immediately before an event time. A participant who has already had the event or has been censored is not in a later risk set. At a tied event time, all participants who fail at that time are counted in \(d_j\), and the risk set is the one just before the tied failures.
From Event Indicators to the Score
For participant \(i\), let \(A_i=1\) for treatment and \(A_i=0\) for control. Let \(Y_i(t)\) indicate whether participant \(i\) is at risk just before time \(t\), and let \(N_i(t)\) count that participant’s events by time \(t\). At \(t_j\), the event indicator increment \(\Delta N_i(t_j)\) is 1 if participant \(i\) has an event then and 0 otherwise. Summing these increments within each group gives \(d_{1j}\) and \(d_{0j}\).
The treatment fraction in the risk set is \(\bar A_j=Y_{1j}/Y_j\). Thus the contribution at \(t_j\) can also be written as the sum, over those who have an event, of their treatment indicator minus the risk-set treatment fraction. The weighted score has the individual-event representation
Each treatment event contributes \(1-\bar A_j\), and each control event contributes \(-\bar A_j\), before multiplication by \(w_j\). This centering makes the contribution a comparison with the treatment share of the people still at risk, rather than with the treatment share originally randomized.
Null Expectation and Variance
Under the null hypothesis of equal event hazards in the two groups, condition on the risk set and on there being \(d_j\) events at \(t_j\). With no tied events, the event is from the treatment group with probability \(Y_{1j}/Y_j\). Hence the expected number of treatment events is \(d_jY_{1j}/Y_j\). When \(d_j=1\), the variance of the treatment event indicator is \((Y_{1j}/Y_j)(Y_{0j}/Y_j)\).
For tied events, a standard conditional calculation treats the \(d_j\) failing participants as a sample without replacement from the \(Y_j\) people at risk under the null. The number of treatment events then has a hypergeometric distribution. This gives the finite-population variance below. It is exact under the stated conditional allocation model; a common large-risk-set approximation omits its finite-population correction.
The square on \(w_j\) is essential: multiplying a score contribution by \(w_j\) multiplies its variance by \(w_j^2\). Contributions at distinct event times are martingale differences under the null, so their cross-products have conditional expectation zero. Adding the event-time conditional variances therefore gives the variance of the cumulative score. In large samples, when the total variance is not dominated by a few event times, \(U_W/\sqrt{\widehat V_W}\) is approximately standard normal under the null.
Why Predictability Is Required
A weight is predictable when its value at \(t_j\) is determined by time and information available strictly before the event outcomes at \(t_j\) are observed. A fixed function of time is predictable. So is a weight calculated from a pooled survival estimate using only event and censoring history before \(t_j\). Such a weight is fixed when the conditional null expectation of the current event contribution is taken, preserving its mean-zero property.
In counting-process terms, under equal hazards and independent censoring, the event increment for a participant at risk has conditional event rate \(\lambda_0(t)\). The centered group indicator sums to zero over the risk set:
Consequently, multiplying the centered event increments by a weight known just before \(t\) leaves a score with conditional mean zero under the null. If the weight is chosen using which group has more events at \(t_j\), it is no longer fixed under that conditional expectation. The score can then be biased away from zero even when the null is true, and the usual variance formula does not repair that problem.
Worked Example: A Weighted Score With Single Events
Consider a hypothetical randomized trial with three event times and no tied failures. At the first time, \(Y_{1,1}=6\), \(Y_{0,1}=4\), and the treatment group has the event. At the second time, \(Y_{1,2}=5\), \(Y_{0,2}=4\), and the control group has the event. At the third time, \(Y_{1,3}=3\), \(Y_{0,3}=4\), and the treatment group has the event. The later risk sets are consistent with two treatment participants being censored between the second and third event times. Suppose the weights are \(1\), \(2\), and \(0.5\), respectively.
There is one event at each time, so \(d_j=1\). The unweighted observed-minus-expected contributions are:
Multiplying each by its weight and adding gives
For single events, each variance contribution is \(w_j^2(Y_{1j}/Y_j)(Y_{0j}/Y_j)\). Thus
The standardized score is \(Z=-0.4254/\sqrt{1.2889}=-0.3747\). Its negative sign indicates fewer weighted treatment events than expected under the null; this example does not provide strong evidence of a difference. The standard-normal two-sided approximation gives a p-value of about 0.708. All event-time weights are treated as fixed or known from the history before their respective events.
Worked Example: Variance With Tied Events
In a hypothetical study, suppose that immediately before one event time there are \(Y_1=4\) treatment participants and \(Y_0=6\) control participants at risk. Three participants fail at that time, including two from treatment, so \(Y=10\), \(d=3\), and \(d_1=2\). Let the predictable weight at this time be \(w=1.5\).
The expected number of treatment events under the null is \(dY_1/Y=3(4/10)=1.2\). The weighted score contribution is therefore
The hypergeometric variance of the unweighted treatment event count is
After applying the weight, the variance contribution is \(w^2(0.56)=1.5^2(0.56)=1.26\). Omitting the finite-population correction would give \(w^2d(Y_1/Y)(Y_0/Y)=2.25(3)(0.4)(0.6)=1.62\), a larger approximation in this example. The exact conditional variance accounts for sampling without replacement from the risk set.
Weights Based on Prior Event History
A history-based weight must be calculated in a way that does not use the current event outcomes. For example, a pooled Kaplan–Meier survival estimate immediately before \(t_j\) uses only earlier event and censoring information, and can therefore define a predictable weight. The calculation below illustrates the timing requirement; it does not prescribe a particular weighting strategy.
Worked Example: Checking a History-Based Weight
Suppose a hypothetical trial begins with five treatment and five control participants at risk. There are two single-event times. The first event is in control. Immediately before the second event, the risk set is five treatment and four control participants, and the second event is in treatment. Define \(w_j\) as the pooled Kaplan–Meier survival estimate just before event time \(t_j\).
Before the first event, the pooled survival estimate is 1, so \(w_1=1\). The first event occurs with ten people at risk, making the pooled survival estimate after that event \(1-1/10=0.9\). Thus, using only prior history, \(w_2=0.9\).
At the first time, the score contribution is \(1(0-1/2)=-0.5\). At the second time, it is \(0.9(1-5/9)=0.9(4/9)=0.4\). Hence \(U_W=-0.5+0.4=-0.1\). The variance is
The standardized value is \(-0.1/\sqrt{0.45}=-0.1491\). Both weights were known before their event outcomes: \(w_2\) used the first event but not the second. Defining \(w_2\) from the treatment-versus-control event difference at the second time would violate predictability.
Assumptions, Diagnostics, and Alternatives
The derivation relies on correctly recorded event times and group membership, valid risk sets, and a null model in which the two groups have equal event hazards conditional on being at risk. Censoring must not be informative about the event process in a way that invalidates the risk-set comparison. In a randomized trial, randomization supports treatment-group comparability, but does not excuse incorrect handling of censoring, ties, or stratification.
- Check the risk-set arithmetic. After each event time, remove the participants who failed, and remove censored participants before the next event time. Risk-set counts should reconcile with the data.
- Check tie handling. Use one consistent convention for the risk set immediately before tied failures, the number of events \(d_j\), and the variance calculation. A single-event variance formula is not the exact tied-event variance.
- Check the weights’ timing. Document the information used to calculate every \(w_j\). A weight using current treatment-specific event outcomes is not predictable.
- Check variance contributions. Each contribution is nonnegative and includes \(w_j^2\). A zero total variance means the standardized statistic is undefined, not zero.
- Check the normal approximation. A few very large weighted contributions, few total events, or very small estimated variance can make the normal approximation unreliable.
With \(w_j=1\) at every event time, the score reduces to the ordinary logrank score. The weighted version retains the same risk-set comparison but changes the relative contribution of event times. A Cox score test under the proportional-hazards model is closely related to the unweighted logrank test; a weighted score is not automatically a test of one constant hazard ratio. In group sequential use, cumulative weighted scores and their corresponding variance estimates can be monitored, but changing weights or recalculating them using current outcomes can undermine the intended null calibration.
Weights do not create information where few events occur, and an unsuitable weighting pattern can reduce power. Their interpretation also depends on the weighting rule: a weighted score summarizes departures from the null according to that rule, rather than providing a universal summary of treatment effect. Selection of weights for a particular delay or time pattern is a design decision that should be made before examining the treatment contrast.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions.
- At an event time, \(Y_1=8\), \(Y_0=12\), and \(d=1\), with a treatment event and weight \(w=2\). Find the score contribution and its variance contribution.
- Why does a tied-event variance include a finite-population correction?
- A weight at time \(t_j\) is calculated from the treatment-control difference in events observed at \(t_j\). Is it predictable, and why does that matter?
- What does a negative weighted logrank score mean under the sign convention used here?
Solutions. (1) The treatment risk-set fraction is \(8/20=0.4\), so the score contribution is \(2(1-0.4)=1.2\). For one event, its variance contribution is \(2^2(8/20)(12/20)=4(0.24)=0.96\). (2) Conditional on \(d\) failures, tied failures are sampled without replacement from the risk set under the null; the factor \((Y-d)/(Y-1)\) adjusts for this dependence. (3) No. It uses current event outcomes, so the weight is not fixed when conditioning on those outcomes; the usual mean-zero derivation does not apply. (4) It means fewer weighted treatment events occurred than expected from the treatment share of the risk sets. It does not, by itself, establish a treatment benefit or identify a causal effect.