Tutorials › Group Sequential Methods and Sample Size Re-Estimation › Logrank And Cox Score Test Equivalence

Group Sequential Logrank Tests · Tutorial 489 of 699

Logrank And Cox Score Test Equivalence

See how the logrank score and the two-arm Cox score coincide under the null, and learn which assumptions and tie-handling choices are needed for their tests to match.

Advanced 10 min read

What You'll Learn

  • Derive the two-arm Cox partial-likelihood score at a zero treatment coefficient.
  • Match its null information to the ordinary logrank variance when event times are distinct.
  • Distinguish exact equivalence from approximations used with tied event times.
  • Check the risk-set, censoring, and model assumptions needed for valid inference.
  • Interpret worked score statistics and recognize when a numerical match should not be expected.

Why the Logrank Test Is a Cox Score Test

The two-arm logrank test compares the observed number of events in one arm with the number expected from the allocation of participants still at risk at each event time. The Cox proportional-hazards model makes the same comparison through its partial likelihood: at the null treatment effect, each event contributes the observed treatment indicator minus its risk-set average. This is more than a resemblance in formulas. With distinct event times and a treatment-only Cox model, the logrank score, its null information, and the Cox score test statistic coincide.

That equivalence has specific conditions. It concerns the unadjusted two-arm comparison and the score test evaluated at the null treatment coefficient. Tied event times require attention to the method used to handle ties, because common Cox approximations and the conventional logrank variance do not always produce the same information.

Definition: Let \(x_i=1\) for a participant in the treatment arm and \(x_i=0\) for a participant in the control arm. At an event time \(t_j\), let \(R_j\) be the risk set just before that event, \(n_{1j}\) and \(n_{0j}\) the numbers at risk in the treatment and control arms, and \(n_j=n_{1j}+n_{0j}\). If participant \(i(j)\) has the event at \(t_j\), the logrank score, using the treatment-minus-control sign convention, is \(U=\sum_j(x_{i(j)}-n_{1j}/n_j)\). With distinct event times, its null information is \(I=\sum_j(n_{1j}/n_j)(n_{0j}/n_j)\). The standardized score is \(Z=U/\sqrt{I}\).

A positive \(U\) means that more treatment-arm events occurred than expected under the null, given the risk sets. In a Cox model with treatment coefficient \(\beta\), the hazard ratio for treatment versus control is \(\exp(\beta)\), so positive values of the score point toward a higher treatment hazard. For a two-sided test, the usual large-sample score statistic is \(Z\), compared with a standard normal distribution under \(H_0:\beta=0\).

Deriving the Equality

Consider the Cox model \(\lambda_i(t)=\lambda_0(t)\exp(\beta x_i)\), where \(\lambda_0(t)\) is an unspecified baseline hazard. For distinct event times, the partial log-likelihood contribution from the participant who fails at \(t_j\) is that participant’s linear predictor minus the log of the sum of exponentiated predictors across the risk set. Thus

$$ \ell(\beta)=\sum_j\left[\beta x_{i(j)}-\log\left\{\sum_{i\in R_j}\exp(\beta x_i)\right\}\right]. $$

Differentiating with respect to \(\beta\) gives the score. The second derivative gives the curvature of the log partial likelihood; its negative is the information used for the score test.

1
Differentiate the partial log-likelihood.
\(\displaystyle U(\beta)=\sum_j\left[x_{i(j)}-\frac{\sum_{i\in R_j}x_i\exp(\beta x_i)}{\sum_{i\in R_j}\exp(\beta x_i)}\right].\)
2
Evaluate the score under the null.
At \(\beta=0\), every risk-set weight is equal. The weighted mean of the binary treatment indicator is therefore \(n_{1j}/n_j\), giving \(\displaystyle U(0)=\sum_j(x_{i(j)}-n_{1j}/n_j)\), exactly the logrank score.
3
Evaluate the information under the null.
The risk-set variance of a binary indicator with \(n_{1j}\) ones and \(n_{0j}\) zeros is \(\displaystyle (n_{1j}/n_j)(n_{0j}/n_j)\). Summing these variances over distinct event times gives the Cox information \(\displaystyle I(0)=\sum_j(n_{1j}/n_j)(n_{0j}/n_j)\), the ordinary logrank variance.
4
Form the test statistic.
Both procedures use the same score and information, so their signed standardized statistics agree: \(\displaystyle U(0)/\sqrt{I(0)}=U/\sqrt{I}\).

The information statement can also be understood conditionally. Under the null, if exactly one participant fails from a risk set, each person in that set has the same chance of being the one who fails. The treatment indicator of that event has mean \(n_{1j}/n_j\) and variance \((n_{1j}/n_j)(n_{0j}/n_j)\). The score contribution is the observed indicator minus its conditional mean, so its variance is precisely the risk-set term in \(I\). This connects the Cox likelihood calculation to the logrank observed-minus-expected construction.

Worked Calculations With Distinct Event Times

Worked Example: Matching the Score and Information Event by Event

Suppose a hypothetical trial has three distinct event times. Immediately before them, the risk sets and observed failures are: \((n_1,n_0)=(4,4)\), treatment event; then \((3,4)\), control event; then \((3,3)\), treatment event. These risk sets follow from removing each failed participant after their event. Assume there is no other entry or removal between the listed times.

At the first event, the treatment expectation is \(4/8=1/2\), so the score contribution is \(1-1/2=1/2\), and the information contribution is \((4/8)(4/8)=1/4\). At the second, the contribution is \(0-3/7=-3/7\), with information \((3/7)(4/7)=12/49\). At the third, it is \(1-3/6=1/2\), with information \(1/4\).

Therefore, \(\displaystyle U=\frac12-\frac37+\frac12=\frac47\approx0.5714\), and \(\displaystyle I=\frac14+\frac{12}{49}+\frac14=\frac{73}{98}\approx0.7449\). The signed statistic is \(\displaystyle Z=\frac{4/7}{\sqrt{73/98}}\approx0.6621\). A two-sided standard-normal approximation gives \(p\approx0.508\). The score is positive, but these few events provide little evidence against equal hazards. Because the example has only three events, the normal approximation is for illustrating the calculation, not a claim of precise small-sample calibration.

Worked Example: Censoring Changes the Risk Set, Not the Equality

In a second hypothetical trial, start with three participants in each arm. The first event is in control. Before the second event, one treatment participant is censored without an event; the second event is in treatment. The third event is in control, and the fourth is in treatment. The successive risk sets are therefore \((3,3)\), \((2,2)\), \((1,2)\), and \((1,1)\).

The four score contributions are \(-1/2\), \(1-2/4=1/2\), \(-1/3\), and \(1-1/2=1/2\). Thus \(\displaystyle U=-\frac12+\frac12-\frac13+\frac12=\frac16.\) The information contributions are \(1/4\), \(1/4\), \(2/9\), and \(1/4\). Hence \(\displaystyle I=\frac14+\frac14+\frac29+\frac14=\frac{35}{36}.\) The standardized score is \(Z=1/\sqrt{35}\approx0.1690\), with a two-sided normal-approximation \(p\)-value of about \(0.866\).

Censoring is handled by the risk set: the censored participant contributes while at risk, then is no longer included. At each remaining event, the Cox score and logrank score still use the same risk-set mean and variance. This arithmetic assumes the censoring mechanism is non-informative for the event process, conditional on the factors represented in the analysis.

Assumptions and Tied Event Times

The algebraic equality under distinct event times follows directly from the two-arm risk-set structure. Its use as an inferential test also requires conditions for the null distribution to be appropriate. In particular, the risk sets must correctly represent who is event-free and under observation just before each event; censoring should not carry unaccounted information about future event times; and the treatment indicator and event data must be recorded consistently. For causal interpretation of a treatment comparison, random assignment or a justified adjustment strategy is also important.

The Cox model supplies a proportional-hazards framework, but the equality of the score formulas at \(\beta=0\) is an algebraic fact, not proof that hazards are proportional under every alternative. A logrank test can still be computed when hazards are not proportional, although its power and interpretation may be less straightforward. Under the null of equal treatment and control hazards, together with suitable independent-censoring and regularity conditions, the standardized score has an approximately standard normal distribution in large samples.

Ties change the information calculation because more than one event occurs in the same recorded time interval. For \(d\) tied events in a risk set of size \(n\), with \(n_1\) treatment participants and \(n_0\) controls at risk, the conventional logrank score contribution is \(d_1-dn_1/n\), where \(d_1\) of the tied failures are in treatment. Its hypergeometric variance is \(\displaystyle d\frac{n_1}{n}\frac{n_0}{n}\frac{n-d}{n-1}\). That finite-population correction reflects drawing \(d\) people without replacement from the risk set. It is not generally the same as the Breslow Cox information \(d(n_1/n)(n_0/n)\). Exact conditional Cox handling of ties gives the corresponding conditional allocation variance; common approximate tie methods need not.

Worked Example: A Tie Makes the Information Choice Visible

Suppose, hypothetically, that two events are recorded at the same time while four treatment participants and six controls are at risk. One of the two failures is from treatment and one from control. The conventional tied logrank score contribution is \(\displaystyle U=1-2(4/10)=0.2000.\)

Its hypergeometric variance is \(\displaystyle I_{\text{logrank}}=2(4/10)(6/10)(8/9)=0.4267.\) Thus \(Z=0.2000/\sqrt{0.4267}\approx0.3062\), and the two-sided normal-approximation \(p\)-value is approximately \(0.7595\).

If a Cox calculation instead uses the Breslow approximation, its score contribution at the null is also \(0.2000\), but its information is \(2(4/10)(6/10)=0.4800\). The resulting statistic is \(0.2000/\sqrt{0.4800}\approx0.2887\), not \(0.3062\). The discrepancy is not an arithmetic error: the tied-event information conventions differ. Reported results should therefore identify the tie handling, especially when ties are numerous or event times are heavily rounded.

How to Diagnose a Mismatch and Choose a Comparison

For distinct events, a numerical disagreement between the two implementations is a reason to check the setup rather than an expected methodological difference. Confirm that both analyses use the same participants and event indicator, the same treatment coding, the same event-time ordering, and the same risk-set membership. The sign may be reversed if one implementation defines the score as control-minus-treatment. A stratified logrank calculation should be compared with a Cox model that includes the corresponding stratum-specific baseline structure, not with an unstratified treatment-only model.

For tied events, first compare the score contributions and then the information. The Breslow score at the null can match the usual tied logrank score while its information differs from the hypergeometric variance. Efron tie handling also has its own approximation and need not reproduce the conventional logrank calculation. Align the tie method and variance convention before treating unequal \(Z\) statistics or \(p\)-values as a problem.

ApproachWhat is comparedKey qualification
Two-arm logrank testObserved versus risk-set-expected events, accumulated over event timesConventional tied-event variance uses a finite-population correction.
Cox score test at \(\beta=0\)Derivative of the partial log-likelihood and its null informationWith distinct events and a treatment-only model, it equals the logrank test.
Cox likelihood-ratio or Wald testChange in partial likelihood, or an estimated coefficient relative to its standard errorThese are different test constructions; their finite-sample values need not equal the score test.

The score test is useful when the question is whether the data provide evidence against a zero treatment coefficient, because it is evaluated at the null without requiring the alternative-model coefficient estimate. The equality result is limited, however: it does not make the likelihood-ratio, Wald, and score tests interchangeable in every sample, nor does it turn an unadjusted logrank test into an adjusted Cox analysis. When the analysis includes other covariates, the relevant Cox score is generally not the simple two-arm logrank score.

Common Mistakes and Practical Limits

  • Comparing only the score numerators. Equal scores do not guarantee equal test statistics. The variance or information must also match.
  • Assuming every Cox tie method is identical to logrank. State the tie convention and use the matching variance when comparing results.
  • Ignoring who is at risk. The expected treatment events are based on the risk set at each event, not the original allocation totals.
  • Reading a \(p\)-value as the probability that \(H_0\) is true. It is a tail probability under the null model, not a probability assigned to the null hypothesis.
  • Overstating the alternative interpretation. A score test at \(\beta=0\) is a test within the Cox framework; it does not establish proportional hazards or a causal treatment effect by itself.

In practice, the equivalence provides a useful validation check: with distinct event times, a two-arm logrank implementation and a treatment-only Cox score test should agree in score and information up to sign conventions and numerical rounding. It also clarifies the method’s limits. Informative censoring, incorrect risk sets, treatment-effect adjustment, different tie handling, or a small number of events can affect validity or agreement. A matching statistic alone cannot verify these design and modeling assumptions.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. At one distinct event time, 12 treatment participants and 8 controls are at risk, and a treatment participant has the event. Find that event’s logrank score and information contributions.
  2. State why the treatment-only Cox score at \(\beta=0\) equals the logrank score when event times are distinct.
  3. For two tied failures from a risk set with \(n_1=5\), \(n_0=5\), and \(d_1=1\), calculate the conventional logrank score and hypergeometric variance.
  4. Does an unadjusted logrank test automatically equal a Cox score test adjusted for age? Explain.
  5. In a two-sided test, what does a positive logrank score indicate, and what does it not establish?

Solutions. (1) The treatment risk-set proportion is \(12/20=0.6\). The score contribution is \(1-0.6=0.4000\), and the information contribution is \(0.6(8/20)=0.2400\). (2) At \(\beta=0\), Cox partial-likelihood weights are equal for everyone in the risk set, so the weighted mean treatment indicator is \(n_1/n\), exactly the logrank expected treatment fraction. The corresponding risk-set variance also matches the distinct-event logrank variance. (3) The score is \(1-2(5/10)=0\). The variance is \(2(0.5)(0.5)(8/9)=4/9\approx0.4444\). (4) No. Adjustment changes the Cox score, which incorporates age information; it is not generally the unadjusted logrank score. (5) A positive score means more treatment events than expected from the treatment representation in the risk sets. It does not by itself establish a causal effect or proportional hazards.

Clinical Biostats