Tutorials › Competing Risks and Multi-State Models › Deriving Gray’s Score Statistic

Testing and Design · Tutorial 212 of 699

Deriving Gray’s Score Statistic

Learn how Gray’s score allocates target-cause events across groups using modified, censoring-weighted risk sets, and how to calculate and check each group’s contribution.

Advanced 10 min read

What You'll Learn

  • Define the modified subdistribution risk set used in Gray’s score.
  • Calculate weighted expected target-cause event counts for each group.
  • Derive the group score contribution as observed minus expected events.
  • Check why the group contributions sum to zero.
  • Identify assumptions, diagnostics, and common interpretation errors.
  • Distinguish this score’s target from a cause-specific hazard comparison.

Why Gray’s Score Uses a Modified Risk Set

To compare groups on a target cause, it is not enough to count who remains free of every event. A competing event prevents the target event from occurring later, but it also contributes to the cumulative incidence of the target cause by changing the population’s event experience. Gray’s score addresses this by retaining people with an observed competing event in a modified, weighted risk set. The score then compares observed target-cause events in each group with the group’s weighted share of the total expected events.

Let \(T_i\) be the event time for person \(i\), \(C_i\) the censoring time, and \(X_i=\min(T_i,C_i)\) the observed time. Let \(\Delta_i=I(T_i\leq C_i)\) indicate that an event was observed, and, when \(\Delta_i=1\), let \(J_i\) be its cause. Cause 1 is the target cause; causes \(2,3,\ldots\) are competing causes. The group label is \(Z_i=g\). The target cumulative incidence function in group \(g\) is \(F_{1g}(t)=P(T_i\leq t,J_i=1\mid Z_i=g)\).

Definition: At time \(t\), person \(i\)'s modified risk-set contribution for target cause 1 is $$ Y_i^*(t)=I(X_i\geq t)+I(X_i<t,\ \Delta_i=1,\ J_i\neq 1)\frac{\widehat G(t)}{\widehat G(X_i)}. $$ Here \(\widehat G\) estimates the survival function of the censoring time under the censoring model used for the analysis. The weighted group risk set is \(Y_g^*(t)=\sum_{i:Z_i=g}Y_i^*(t)\), and the total is \(Y^*(t)=\sum_gY_g^*(t)\). A person with an observed competing event before \(t\) contributes the censoring-survival ratio; a person censored before \(t\) contributes zero.

The first indicator includes people whose observed time is at or beyond \(t\), including those who experience the target event at \(t\). This is the risk set immediately before events at that time. The second indicator applies only to an observed competing event before \(t\). It does not apply to a censored person, even if that person’s unobserved event type might have been competing. The ratio is defined only where \(\widehat G(X_i)>0\).

For simplicity, the examples use a common censoring survival estimate \(\widehat G\). The analysis requires censoring to be independent of the event process within the groups, with the censoring distribution estimated appropriately for the design. If censoring patterns differ across groups, the weighting procedure must accommodate those differences; one should not apply a common censoring estimate without justification. The weights also require adequate probability of remaining uncensored over the event times being analyzed.

Deriving the Group Score Contribution

At a target-cause event time \(t_j\), write \(dN_{1g}(t_j)\) for the number of observed target-cause events in group \(g\), and \(dN_1(t_j)=\sum_g dN_{1g}(t_j)\) for the total across groups. Under the null hypothesis of equal target cumulative incidence functions, Gray’s score construction assigns the total target-event count across groups in proportion to their modified risk-set sizes. Thus the weighted expected count for group \(g\) at this time is \(dN_1(t_j)Y_g^*(t_j)/Y^*(t_j)\).

$$ dU_g(t_j)=dN_{1g}(t_j)-dN_1(t_j)\frac{Y_g^*(t_j)}{Y^*(t_j)}, \qquad U_g=\sum_j dU_g(t_j). $$

The first term is what was observed; the second is the group’s weighted expected share under the null. A positive contribution means that group had more target-cause events than its weighted share at that time, while a negative contribution means it had fewer. This is a score construction for comparing cumulative incidence functions, not a claim that groups have equal cause-specific hazards.

The allocation formula has a simple justification. At a fixed event time, the weighted risk-set fractions sum to one:

$$ \sum_g\frac{Y_g^*(t_j)}{Y^*(t_j)} =\frac{\sum_gY_g^*(t_j)}{Y^*(t_j)}=1. $$

Multiplying each fraction by the same total event count allocates that count across groups. Subtracting the allocated count from the observed count gives the score contribution. Summing across groups therefore yields

$$ \sum_g dU_g(t_j) =dN_1(t_j)-dN_1(t_j)\sum_g\frac{Y_g^*(t_j)}{Y^*(t_j)} =0. $$

The total score across groups is zero at every event time, and hence over follow-up. In a two-group comparison, one group’s score is the negative of the other’s. The score alone does not quantify its sampling variability; that requires a variance estimate and a reference distribution.

Worked Example: Constructing a Modified Risk Set

Suppose the target event time is \(t=4\), with \(\widehat G(4)=0.72\). In group 1, four people have \(X_i\geq4\), one person had an observed competing event at time 3 with \(\widehat G(3)=0.90\), and one person was censored at time 2. In group 2, two people have \(X_i\geq4\), and two had observed competing events at earlier times where \(\widehat G(X_i)=0.96\). There are two target events at time 4, one in each group.

For the competing event in group 1, the contribution is \(0.72/0.90=0.800\). The person censored at time 2 contributes zero because \(\Delta_i=0\). Thus \(Y_1^*(4)=4+0.800=4.800\). Each earlier competing event in group 2 contributes \(0.72/0.96=0.750\), so \(Y_2^*(4)=2+0.750+0.750=3.500\).

The total modified risk set is \(Y^*(4)=4.800+3.500=8.300\). Group 1’s expected count is \(2(4.800/8.300)=1.157\), and its score contribution is \(1-1.157=-0.157\). Group 2’s expected count is \(2(3.500/8.300)=0.8434\), and its contribution is \(1-0.8434=0.1566\). Using unrounded values, the two contributions sum to zero.

Worked Example: Correcting for the Weighted Expected Count

At one distinct target-event time, suppose the weighted risk-set totals are \(Y_1^*=5.778\) and \(Y_2^*=4.600\). There are three target events: two in group 1 and one in group 2. These are hypothetical risk-set summaries calculated from observed follow-up.

The total weighted risk set is \(5.778+4.600=10.378\). Group 1’s expected count is

$$ E_1=3\left(\frac{5.778}{10.378}\right)=1.670264\ldots\approx1.670, \qquad dU_1=2-1.670264\ldots=0.329736\ldots\approx0.330. $$

Group 2’s expected count and contribution are

$$ E_2=3\left(\frac{4.600}{10.378}\right)=1.329736\ldots\approx1.330, \qquad dU_2=1-1.329736\ldots=-0.329736\ldots\approx-0.330. $$

The expected counts sum to 3, the observed total, and the unrounded contributions sum to zero. The positive contribution for group 1 records an excess of about 0.330 target events relative to its weighted expectation at this time. It is not, by itself, a test result or a measure of uncertainty.

Accumulating Contributions Over Event Times

Gray’s group score accumulates the observed-minus-expected contribution at each target-event time. The following hypothetical example uses two distinct event times and gives the weighted risk sets already evaluated at each time.

Worked Example: Adding Score Contributions Across Times

At the first time, \(Y_1^*=6\), \(Y_2^*=4\), and there are two target events, both in group 1. At the second time, \(Y_1^*=3.5\), \(Y_2^*=4.5\), and there is one target event, in group 2.

At the first time, group 1’s expected count is \(2(6/10)=1.2\), so its contribution is \(2-1.2=0.8\). Group 2’s expected count is \(2(4/10)=0.8\), so its contribution is \(0-0.8=-0.8\).

At the second time, the total weighted risk set is \(3.5+4.5=8\). Group 1’s expected count is \(1(3.5/8)=0.4375\), giving a contribution of \(0-0.4375=-0.4375\). Group 2’s expected count is \(1(4.5/8)=0.5625\), giving \(1-0.5625=0.4375\).

The accumulated scores are \(U_1=0.8-0.4375=0.3625\) and \(U_2=-0.8+0.4375=-0.3625\). The positive final score for group 1 reflects its net excess of target events relative to weighted expectations over these two times. It does not mean group 1 had more events in total: group 1 had two and group 2 had one. The score accounts for the time-specific weighted risk sets as well as the observed counts.

Assumptions, Checks, and Comparisons

The score is meaningful when the group membership and event causes are recorded correctly, observations are independent across people, and censoring is noninformative under the censoring model used for the weights. There must also be enough uncensored follow-up to estimate \(\widehat G\) and form the ratios at relevant event times. The null being assessed is equality of the target cumulative incidence functions over the follow-up range, not equality of every aspect of the event-time distributions.

Before relying on a computed score, check the construction as well as the arithmetic. Each observed target event should enter the observed count for exactly one group. Each expected count should use the same total target-event count multiplied by that group’s share of the total modified risk set. The expected counts must sum to the total observed target events at each time, and the group contributions must sum to zero, up to rounding. Check that a censored person whose censoring time precedes \(t\) receives no contribution to \(Y_g^*(t)\), and that competing-event weights are between zero and one when \(\widehat G\) is a nonincreasing survival function and its denominator is positive.

A cause-specific log-rank comparison addresses a different question: it compares cause-specific event rates among people still free of any event. It does not, by itself, test equality of the target cumulative incidence functions when competing-event patterns differ. Direct cumulative-incidence estimates can describe the group-specific curves, but do not supply this score’s observed-versus-weighted-expected construction. Gray’s score is designed for the cumulative-incidence comparison; the variance calculation and test reference distribution are separate steps.

A common mistake is to include everyone whose latent event type might have been a competing cause in the second part of the modified risk set. That reasoning treats an unobserved cause as though it had been observed. The correction is to require \(\Delta_i=1\) as well as \(J_i\neq1\); a person censored before \(t\) contributes zero. Another mistake is to call the expected count the number of events that “should” occur in a particular group. It is the null-based weighted allocation used to construct the score, not a prediction for an individual or a guarantee about a future sample.

Key takeaway: At each target-event time, Gray’s group contribution is the observed target-event count minus the total target-event count multiplied by the group’s share of the modified weighted risk set. Use observed competing events—not censored individuals—to form the retained, weighted part of that risk set.

Check Your Understanding

Work through each question, then compare your reasoning with the solutions.

  1. At time \(t\), a person was censored at \(X_i<t\). What is their modified risk-set contribution, and why?
  2. Two groups have weighted risk sets 30 and 20 at an event time with five target events, two in group 1 and three in group 2. Calculate both expected counts and score contributions.
  3. Why must the group score contributions sum to zero at each event time?
  4. Does a positive score contribution establish that a group’s cause-specific hazard is larger? Explain.

Solutions. (1) The contribution is zero: the second indicator requires an observed competing event, \(\Delta_i=1\), whereas this person was censored. (2) The total weighted risk set is 50. Group 1 has expected count \(5(30/50)=3\) and contribution \(2-3=-1\). Group 2 has expected count \(5(20/50)=2\) and contribution \(3-2=1\). (3) The group risk-set shares sum to one, so expected counts sum to the total observed count; subtracting those expected counts from the observed counts therefore gives a total of zero. (4) No. A positive contribution means observed target events exceeded that group’s weighted expected count at the considered time or, for an accumulated score, over the included times. It is not a direct statement about the cause-specific hazard.

Clinical Biostats