What Does Gray’s Test Compare?
When two groups are compared in a competing-risks setting, the scientific question may be whether their probabilities of experiencing a particular event by time \(t\) differ. Gray’s test is designed to compare the cumulative incidence functions (CIFs) for a specified cause. Its null hypothesis is therefore about those functions over follow-up—not simply about whether the event’s instantaneous rate is the same in each group.
That distinction matters because a person can experience only one first event: an event of the target cause or a competing event. The probability of the target event by a given time depends both on its own event rate and on how many people remain event-free rather than experiencing a competing event. The null hypothesis must match the quantity the test is intended to compare.
The null is a statement about the full target-cause incidence curves in the chosen population and time window. It does not require the groups to have equal cumulative incidence for every competing cause. Nor does it assert that the groups have identical event histories or that every feature of their outcome distributions is equal. If the scientific question concerns only the probability by one particular endpoint, equality at that endpoint is a different, narrower hypothesis.
Why the Null Is Not a Cause-Specific-Hazard Null
A cause-specific hazard describes the instantaneous rate of a particular event among people who are still event-free just before time \(t\). Write \(\lambda_{j,g}(t)\) for the cause-specific hazard of cause \(j\) in group \(g\). It is conditional on remaining free of all event types until just before \(t\). By contrast, \(F_{k,g}(t)\) is an unconditional probability in the group: it is the probability of having experienced cause \(k\) by time \(t\), with a competing event preventing a later target event.
With continuous event times and cause-specific hazards, let \(S_g(t)=P(T>t\mid\text{group}=g)\) be the probability of remaining free of every event through time \(t\). The target-cause CIF is obtained by accumulating target-cause event probability among those still event-free:
This expression gives a direct justification. Over a short interval from \(u\) to \(u+du\), the probability of still being event-free at \(u\) is approximately \(S_g(u)\), and the conditional probability of a target event in the interval is approximately \(\lambda_{k,g}(u)\,du\). Their product is the approximate unconditional probability of a target event in that interval. Adding those contributions over time gives the CIF. In settings with jumps or discrete event times, the corresponding general expression is an integral with respect to the cumulative cause-specific hazard, using survival immediately before each time.
Because \(S_g\) depends on the hazards of all event causes, equal target-cause hazards do not generally produce equal target-cause CIFs. Conversely, equality of the target CIF curves does not require equality of the target cause-specific hazards: a change in the event-free survival probability can offset a change in the target hazard. These are different hypotheses about different features of the event process.
Worked Example: Equal Target Hazards, Different Target Incidence
Suppose two hypothetical groups have constant cause-specific hazards per year for two causes. Cause 1 is the target event. Group A has \(\lambda_{1,A}=0.20\) and \(\lambda_{2,A}=0.10\); Group B has \(\lambda_{1,B}=0.20\) and \(\lambda_{2,B}=0.40\). Assume independent individuals, no censoring before the time being evaluated, and constant hazards over the interval.
The target-cause hazards are equal, but the overall event-free survival probabilities differ. With constant hazards, the target CIF at time \(t\) is $$ F_{1,g}(t)=\frac{\lambda_{1,g}}{\lambda_{1,g}+\lambda_{2,g}} \left[1-\exp\{-(\lambda_{1,g}+\lambda_{2,g})t\}\right]. $$ At \(t=2\) years, Group A has total hazard \(0.20+0.10=0.30\) per year, so $$ F_{1,A}(2)=\frac{0.20}{0.30}\left[1-\exp(-0.30\times2)\right] =0.6667(1-0.5488)=0.3008. $$ Group B has total hazard \(0.20+0.40=0.60\) per year, so $$ F_{1,B}(2)=\frac{0.20}{0.60}\left[1-\exp(-0.60\times2)\right] =0.3333(1-0.3010)=0.2330. $$ Thus, the target cause-specific hazards are both \(0.20\) per year, but the hypothetical probability of the target event by two years is about \(0.301\) in Group A and \(0.233\) in Group B. The higher competing-event hazard in Group B leaves fewer people available to experience the target event. A null of equal target hazards would hold in this example, while the equality-of-CIF null would not.
Worked Example: State Gray’s Null for a Target Cause
A hypothetical study compares two treatment groups for the first occurrence of relapse (cause 1) or death before relapse (cause 2). The prespecified comparison window is five years. State the null and alternative for a Gray test of relapse incidence.
Here \(k=1\) is relapse and \(\tau=5\) years. The null is $$ H_0:\ F_{1,1}(t)=F_{1,2}(t)\quad\text{for every }0\le t\le5\text{ years}. $$ The alternative is that the relapse CIFs differ for at least one time in that interval: $$ H_a:\ F_{1,1}(t)\ne F_{1,2}(t)\quad\text{for some }t\in[0,5\text{ years}]. $$
The cause label and time window make the hypothesis explicit. The null does not require equal death-before-relapse CIFs, and it is not a claim that the relapse hazards are equal among people still event-free. It is also not a claim about treatment causation: in an observational comparison, group differences may reflect factors other than treatment.
Equality Over Time Versus Equality at One Time
The phrase “the CIFs are equal” can be misunderstood as equality at a selected time, such as the end of follow-up. Gray’s null is a curve-level hypothesis: the target-cause CIFs agree throughout the specified interval. A difference at a single time is evidence that the curves are not identical over that interval, but agreement at one time cannot establish that they agree at all other times.
Worked Example: An Endpoint Can Hide a Curve Difference
Consider hypothetical estimated target-cause CIFs for two groups, expressed as proportions. At one year they are \(0.10\) and \(0.06\); at three years they are both \(0.20\); and at five years they are \(0.25\) and \(0.28\).
At three years the two values agree: \(F_{k,1}(3)=F_{k,2}(3)=0.20\). But at one year, \(0.10\ne0.06\), and at five years, \(0.25\ne0.28\). Therefore the curves are not equal over the full interval from zero to five years. The equality at three years answers only the endpoint-specific question at \(t=3\); it does not satisfy Gray’s curve-level null.
This example describes the logical distinction, not a test result. To decide whether observed data provide evidence against the null requires an inferential procedure and its assumptions; a few estimated values alone do not supply a p-value or uncertainty assessment.
Equality of CIFs also need not imply equality of cause-specific hazards. To see why, consider a hypothetical continuous-time construction. In Group A, let both cause-specific hazards be \(0.20\) per year at all times. In Group B, let both hazards match Group A through year 1. After year 1, set the competing-cause hazard in Group B to \(0.50\) per year, and choose its target hazard so that \(S_B(t)\lambda_{1,B}(t)=0.20\exp(-0.40t)\). This is possible by defining \(\lambda_{1,B}(t)=0.20\exp(-0.40t)/S_B(t)\), where \(S_B\) follows from the specified hazards. Then the target CIF has the same instantaneous increase in both groups after year 1, and it already had the same accumulated value before year 1. The target CIFs remain equal even though Group B’s target hazard can differ from Group A’s after year 1. This construction illustrates that the CIF and cause-specific hazard hypotheses are not interchangeable.
Assumptions and Scope of the Hypothesis
The null itself defines a population comparison, but interpreting a test based on observed data requires a suitable design and observation process. In particular, the groups and target cause must be defined consistently, event types must be classified correctly, and the comparison window must be meaningful for both groups. A standard analysis also relies on appropriate handling of censoring so that observed follow-up supports estimation of the group-specific CIFs. The detailed censoring conditions and test variance are separate technical issues.
The null does not specify the shape of the curves, require a constant hazard ratio, or state that any difference must have the same direction at every time. It is an omnibus equality statement: any departure in the target CIF somewhere in the window is covered by the alternative. How a particular test responds to different patterns of departures is a matter of its statistic and weighting, not part of the null’s definition.
A Gray test is commonly contrasted with a cause-specific log-rank test. At the level of the scientific null, the distinction is straightforward: Gray’s test targets equality of a cause-specific CIF, whereas a cause-specific log-rank analysis concerns equality of cause-specific hazards. Neither hypothesis is automatically a causal hypothesis. Even in a randomized study, a causal interpretation must match the treatment assignment, outcome definition, and estimand; in an observational study, confounding and the chosen causal assumptions also matter.
Common Mistakes and Practical Checks
- Substituting hazard equality for the Gray null. Equal cause-specific hazards do not ensure equal CIFs, because competing events change event-free survival. State the hypothesis in terms of \(F_{k,g}(t)\).
- Testing the wrong cause. A CIF is defined for a particular event type. Name the target cause before writing the null; a death CIF is not the same estimand as a relapse CIF.
- Checking only the final time. Equality at a single endpoint does not establish equality of the curves over follow-up. Specify whether the question concerns an endpoint risk or the full interval.
- Calling a group comparison a treatment effect. A test of group CIFs is not, by itself, a causal analysis. Describe it as a group comparison unless the design and assumptions support a causal interpretation.
- Ignoring the follow-up window. The claim “equal over follow-up” should identify the interval being considered. If late follow-up is sparse, the data may provide limited information about the tail even when the hypothesis is defined through that time.
Before interpreting a Gray-test result, check that the event of interest, competing events, groups, and time window match the scientific question. Plotting the group CIF estimates can help reveal the timing and direction of visible differences, but the plot alone does not determine the formal test result.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- For two groups and target cause \(k\), write Gray’s null over a follow-up window ending at \(\tau\).
- Does equality of the target cause-specific hazards guarantee equality of the target CIFs? Give the reason.
- Two estimated CIFs are equal at year 4 but differ at year 2. Are the curves equal over years 0 through 4?
- In a comparison of relapse and death before relapse, what does a Gray test of relapse incidence compare?
- Does rejecting equality of group CIFs, by itself, show that treatment caused a difference?
Solutions. (1) \(H_0:F_{k,1}(t)=F_{k,2}(t)\) for every \(t\in[0,\tau]\). (2) No. The CIF also depends on the probability of remaining free of all event types, which is affected by competing-cause hazards. (3) No. A difference at year 2 means the curves are not identical throughout the interval, despite agreement at year 4. (4) It compares the groups’ probabilities of experiencing relapse by each time \(t\), accounting for death before relapse as a competing event in the CIF definition. (5) No. The result is evidence about a group-level CIF difference under the analysis assumptions; a causal conclusion requires an appropriate design and causal assumptions.