Tutorials › Group Sequential Methods and Sample Size Re-Estimation › The Logrank Variance From Risk-Set Allocation

Group Sequential Logrank Tests · Tutorial 483 of 699

The Logrank Variance From Risk-Set Allocation

Learn to calculate each logrank variance contribution from the numbers at risk in each group and combine them into the cumulative variance.

Advanced 10 min read

What You'll Learn

  • Define the risk-set treatment fraction immediately before an event.
  • Derive the single-event logrank variance from the event’s treatment allocation.
  • Sum event-level contributions to obtain the usual cumulative logrank variance.
  • Calculate cumulative scores and variances from changing risk sets.
  • Diagnose errors caused by using the original allocation ratio instead of the current risk set.
  • Compare variance contributions under balanced and imbalanced risk sets.

Why the Risk Set Determines the Variance

At each event time, the logrank score compares the treatment group that experienced the event with the treatment group’s expected share of the event, given who was still at risk. Its variance is determined by that same allocation in the current risk set. It is not generally determined by the allocation at randomization: participants may have experienced an event or been censored before the event time being considered.

The earlier material on deriving the logrank score from the Cox model gives the score’s observed-minus-expected structure. Here the focus is its variance contribution, derived directly from the possible treatment allocation of a single event. The derivation assumes two groups, one event at each event time, and a null hypothesis of equal event hazards between groups. It also assumes censoring does not selectively remove participants who would otherwise be at higher or lower event risk, conditional on the model. Tied events require a different event-time calculation and are outside the single-event setup used here.

Definition: Immediately before distinct event time \(t_j\), let \(Y_{1j}\) and \(Y_{0j}\) be the numbers at risk in the treatment and control groups, and let \(Y_j=Y_{1j}+Y_{0j}\). Let \(X_j=1\) if the event is in the treatment group and \(X_j=0\) if it is in the control group. For a single event, the logrank score contribution is \(U_j=X_j-Y_{1j}/Y_j\), and its null variance contribution is \(V_j=Y_{1j}Y_{0j}/Y_j^2\).

Deriving the Single-Event Contribution

Under the null hypothesis of equal hazards, the event is equally likely to come from any one of the \(Y_j\) people at risk, conditional on one event occurring at \(t_j\). Therefore the probability that the event is in the treatment group is the treatment fraction in that risk set:

$$ P(X_j=1\mid \text{one event at }t_j)=\frac{Y_{1j}}{Y_j}=p_j. $$

Thus \(X_j\) is an indicator with a Bernoulli distribution, with mean \(p_j\) and variance \(p_j(1-p_j)\). The logrank contribution subtracts that expected treatment allocation from the observed allocation. Subtracting a constant changes the mean but not the variance, so

$$ E(U_j\mid \text{risk set})=E(X_j-p_j)=0, \qquad \operatorname{Var}(U_j\mid \text{risk set}) =\operatorname{Var}(X_j) =p_j(1-p_j). $$

Substituting \(p_j=Y_{1j}/Y_j\) and \(1-p_j=Y_{0j}/Y_j\) gives the risk-set variance formula:

$$ V_j =\frac{Y_{1j}}{Y_j}\frac{Y_{0j}}{Y_j} =\frac{Y_{1j}Y_{0j}}{Y_j^2}. $$

The event contributes \(1-Y_{1j}/Y_j\) to the score if it is in the treatment group, and \(-Y_{1j}/Y_j\) if it is in the control group. The variance does not depend on which group actually has the event: it depends on the risk-set allocation that existed just before it.

Worked Example: One Event in an Imbalanced Risk Set

Suppose that immediately before a distinct event time, 18 participants are at risk in the treatment group and 42 in the control group. One treatment participant has the event. Calculate the expected treatment allocation, the score contribution, and the variance contribution.

The total risk set is \(Y_j=18+42=60\). Under the null, the treatment probability for this event is \(18/60=0.30\). The observed treatment event indicator is \(X_j=1\), so the score contribution is

$$ U_j=1-\frac{18}{60}=0.700. $$

The variance contribution is

$$ V_j=\frac{18(42)}{60^2} =\frac{756}{3600} =0.210. $$

The standard deviation of this single contribution under the null is \(\sqrt{0.210}=0.4583\). If instead the event had been in the control group, the score would have been \(0-0.30=-0.300\), while the variance would still have been \(0.210\). This is a variance calculation for one event contribution, not a standardized test of a whole trial.

Accumulating Contributions Across Event Times

For \(D\) distinct event times, add the score contributions to obtain the cumulative logrank score. The usual null variance estimate is the sum of the corresponding risk-set contributions. The event-level formula above supplies each term; the risk set is updated as participants experience events or leave observation before later event times.

$$ U=\sum_{j=1}^{D} U_j =\sum_{j=1}^{D}\left(X_j-\frac{Y_{1j}}{Y_j}\right), \qquad \widehat V=\sum_{j=1}^{D}V_j =\sum_{j=1}^{D}\frac{Y_{1j}Y_{0j}}{Y_j^2}. $$

The variance is accumulated using the risk set at each event, rather than by multiplying the number of events by one fixed variance contribution. The risk-set composition can change during follow-up, so the contribution can change too. Under the usual logrank construction, \(\widehat V\) is the variance used to standardize the cumulative score under the null. The event-by-event derivation here explains its terms; it does not replace the separate justification of dependence across sequential score increments.

Worked Example: Summing Scores and Variances

Consider three distinct event times with the following risk sets and event groups. These hypothetical risk sets can arise if participants leave the risk set through earlier events or censoring. Assume the stated null and censoring conditions hold.

Event timeTreatment at riskControl at riskGroup with event
13030Treatment
22829Control
32727Treatment

At time 1, the treatment risk-set fraction is \(30/60=0.5\). The score and variance contributions are \(1-0.5=0.5\) and \(30(30)/60^2=0.25\).

At time 2, the treatment fraction is \(28/57\). Since the event is in the control group, \(X_2=0\), giving

$$ U_2=0-\frac{28}{57}=-0.4912, \qquad V_2=\frac{28(29)}{57^2} =\frac{812}{3249} =0.2499. $$

At time 3, the treatment fraction is \(27/54=0.5\), and the treatment event gives \(U_3=0.5\) and \(V_3=27(27)/54^2=0.25\). Therefore,

$$ U=0.500-0.4912+0.500=0.5088, \qquad \widehat V=0.250+0.2499+0.250=0.7499. $$

The standard error of the cumulative score under the null is \(\sqrt{0.7499}=0.8660\). Its standardized value is \(U/\sqrt{\widehat V}=0.5088/0.8660=0.5875\). The calculation illustrates the accumulation of score and variance; a complete test would also specify its direction and inferential reference distribution.

Risk-Set Balance and Information

For a fixed total \(Y_j\), the variance contribution is largest when the treatment and control counts are as balanced as possible. To see why, write the treatment fraction as \(p_j=Y_{1j}/Y_j\). Then \(V_j=p_j(1-p_j)\), and

$$ p_j(1-p_j)=\frac{1}{4}-\left(p_j-\frac{1}{2}\right)^2 \leq \frac{1}{4}. $$

Equality holds when \(p_j=1/2\). The contribution becomes small when one group is scarce in the risk set, and it is zero if either group has nobody at risk. This is why the relevant balance is the balance among participants still at risk at the event time, not merely the original randomization ratio.

Worked Example: Comparing Variance Under Different Risk-Set Allocations

Compare two hypothetical trials at two distinct event times each. In Trial A, the risk sets are 50 treatment and 50 control at the first event, then 45 and 45 at the second. In Trial B, they are 80 treatment and 20 control, then 72 and 18. The groups’ event identities do not affect these variance calculations.

For Trial A, the first contribution is \(50(50)/100^2=0.25\), and the second is \(45(45)/90^2=0.25\). The total is \(0.25+0.25=0.500\).

For Trial B, the first contribution is \(80(20)/100^2=0.16\), and the second is \(72(18)/90^2=1296/8100=0.16\). The total is \(0.16+0.16=0.320\).

Both examples have two events, but the more imbalanced risk sets in Trial B give a smaller sum of these event-level variance contributions. This comparison isolates the allocation effect; it does not by itself compare overall power or account for other design features.

Checks, Comparisons, and Limitations

A practical calculation should be checked against the risk-set table, not just the final sum. At each event time, verify that \(Y_j=Y_{1j}+Y_{0j}\), use the counts immediately before the event, and confirm that \(0\leq V_j\leq 0.25\). A contribution outside that range indicates an arithmetic or denominator error for this single-event setup.

The risk-set calculation is preferable to assigning every event the variance implied by the original allocation ratio: it uses the actual numbers still at risk at that event. It is also different from treating the observed group of the event as if that alone determined its variance. The observed group determines \(U_j\); the two group counts in the risk set determine \(V_j\). This variance is the one paired with the logrank score under the null, not a direct estimate of the variance of a hazard-ratio estimate.

The derivation has defined boundaries. It assumes a single event at each event time and uses the equal-hazards null to obtain the event’s treatment probability. It does not handle tied events, adjustment by strata, or a variance calculation under a specified alternative. It also relies on appropriate censoring conditions: if censoring selectively removes people according to their unobserved event risk, the observed risk sets may not support the intended comparison. These conditions should be checked against the trial design and follow-up process before interpreting a logrank result.

A common mistake is to use the original randomization fraction \(r\) at every event and set \(V_j=r(1-r)\). That is correct only if the current risk-set treatment fraction is in fact \(r\). For example, if randomization began at 1:1 but the risk set before an event contains 18 treatment and 42 control participants, the correct contribution is \(18(42)/60^2=0.210\), not \(0.25\). The correction is simple: recalculate the two group counts immediately before each event, then use those counts in both the expected score and variance formulas.

Key takeaway: For a single event, the logrank variance contribution is the product of the two risk-set counts divided by the square of their total. Sum these event-specific terms across distinct event times to obtain the usual cumulative null variance estimate.

Check Your Understanding

Answer each question using the risk set immediately before the event. Solutions follow the questions.

  1. There are 12 treatment and 28 control participants at risk. What are the treatment event probability under the null and the variance contribution?
  2. In that same risk set, the event is in the control group. What is the score contribution?
  3. At two event times, the risk sets are 20 treatment and 20 control, then 18 treatment and 22 control. Calculate the summed variance contribution.
  4. Why is it generally incorrect to use the initial randomization proportion for every event-time variance contribution?

Solutions. (1) The total is \(40\), so the null treatment event probability is \(12/40=0.30\), and \(V=12(28)/40^2=336/1600=0.210\). (2) A control event has \(X=0\), so \(U=0-12/40=-0.300\). (3) The contributions are \(20(20)/40^2=0.25\) and \(18(22)/40^2=396/1600=0.2475\); their sum is \(0.4975\). (4) Events and censoring can change the group counts still at risk, so the current treatment fraction may differ from the initial randomization proportion. Use the risk-set counts immediately before each event.

Clinical Biostats