Why Weight the Score Over Time?
Gray’s test compares groups through their cumulative incidence functions (CIFs) for a specified target cause, while accounting for competing events. Its score accumulates time-specific contrasts between observed target-cause events and the numbers expected under the null hypothesis. A weight function changes how strongly each time-specific contrast enters that sum. This is useful when a scientific alternative predicts that group differences will be concentrated early or late in follow-up.
Weighting does not change the outcome being compared: the target-cause CIF remains the focus. It changes the test’s emphasis across event times. Consequently, two weighted scores computed from the same data can differ in magnitude or even sign if the time-specific contributions point in different directions.
The fraction \(Y^*_{1j}/Y^*_{\cdot j}\) is group 1’s share of the modified risk set immediately before the event time. Under the null of equal target-cause CIFs, that fraction determines the expected share of the target-cause events at that time in Gray’s score construction. The modified risk set is essential: people who experience a competing event are not simply treated as ordinary censoring for this comparison.
What a Weight Changes—and What It Does Not
The raw contribution \(A_j\) records the direction and size of the time-specific contrast. A positive value means group 1 had more target-cause events than its modified-risk-set share would suggest at that time; a negative value means fewer. Multiplying by a positive weight changes the contribution’s influence on the total score, not its direction. A weight of zero removes that time’s contribution, while a weight larger than one increases its influence relative to a contribution with weight one.
For example, a weight that decreases over follow-up emphasizes early score contributions relative to late ones. A weight that increases over follow-up does the reverse. “Emphasizes” is relative: it describes the multiplier applied to the score contribution, not the number of events, the size of the CIF difference, or the precision of that contribution.
Choosing Weights for a Time Pattern
A constant weight \(w(t)=1\) gives each time-specific contribution its original scale. A decreasing weight can be used when the prespecified alternative is expected to produce stronger differences earlier. An increasing weight can target an alternative expected to emerge later. These are design choices, not conclusions to make after inspecting which weighting gives the most favorable result.
One commonly used family of Gray-test weights is based on the pooled target-cause CIF. For example, a Fleming–Harrington-type choice is \(w(t)=\hat F_1(t-)^\rho[1-\hat F_1(t-)]^\gamma\), where \(\hat F_1(t-)\) is the pooled target-cause CIF just before time \(t\), and \(\rho,\gamma\) are nonnegative tuning parameters. Setting \(\rho=0\) and \(\gamma>0\) tends to downweight later times as the pooled CIF grows; setting \(\gamma=0\) and \(\rho>0\) tends to give later times more weight. The value just before \(t\) makes the weight depend on information available before the event at \(t\).
The family is a way to express time emphasis, not a guarantee that a chosen weight is optimal. Exact implementation details can vary, so the weight definition and the CIF used to calculate it should be reported. A prespecified simple function of time can also be used, provided it is appropriate for the test’s conditions.
Worked Example: Giving Early Contributions More Weight
Suppose a hypothetical study has two groups and two target-cause event times. At the early time, four target-cause events occur, the group 1 modified-risk-set fraction is \(0.60\), and three events are observed in group 1. At the late time, five events occur, the fraction is \(0.40\), and one event is observed in group 1. Use weights \(0.80\) early and \(0.20\) late.
At the early time, the expected group 1 count under the score’s null allocation is \(0.60(4)=2.4\), so \(A_{\mathrm{early}}=3-2.4=0.60\). Its weighted contribution is \(0.80(0.60)=0.48\).
At the late time, the corresponding expected count is \(0.40(5)=2.0\), so \(A_{\mathrm{late}}=1-2.0=-1.0\). Its weighted contribution is \(0.20(-1.0)=-0.20\).
The weighted score from these two times is \(U_w=0.48-0.20=0.28\). The unweighted sum is \(0.60-1.0=-0.40\). The sign changes because the early and late raw contributions oppose each other and the chosen weights favor the positive early contribution. The early contribution receives four times the weight multiplier of the late contribution, since \(0.80/0.20=4\). These calculations describe score contributions only; they do not provide a variance, p-value, or final test decision.
Why the Weighted Score Has the Same Null Center
The key justification is that the weight rescales a score contribution whose expected value is zero under the null. In the two-group score construction, under the null the expected number of group 1 target-cause events at \(t_j\), conditional on the total number of target-cause events and the modified risk sets, is represented by \((Y^*_{1j}/Y^*_{\cdot j})dN_{1\cdot j}\). Subtracting this expected count gives \(A_j\).
If \(w(t_j)\) is fixed in advance, or is determined by information available just before \(t_j\), it is known for the purpose of weighting that event-time contribution. Thus, under the null,
Summing the contributions preserves a null-centered score. This argument explains why time weighting can target a pattern without changing the null hypothesis being tested. It does not establish the variance or reference distribution of the weighted score; those are required for a test statistic and are handled separately.
Worked Example: A Pooled-CIF Weight That Favors Earlier Times
Consider hypothetical pooled target-cause CIF values of \(0.10\) just before an early event time and \(0.60\) just before a late event time. Use \(w(t)=[1-\hat F_1(t-)]^2\), which downweights times at which the pooled target-cause CIF has already accumulated.
The early weight is \((1-0.10)^2=0.90^2=0.81\). The late weight is \((1-0.60)^2=0.40^2=0.16\). Suppose the raw score contributions are \(0.50\) early and \(-0.75\) late. The weighted contributions are \(0.81(0.50)=0.405\) and \(0.16(-0.75)=-0.120\).
Therefore, the two-time weighted sum is \(0.405-0.120=0.285\), whereas the unweighted sum is \(0.50-0.75=-0.25\). The early multiplier is \(0.81/0.16=5.0625\) times the late multiplier. The resulting difference in sums illustrates how a prespecified early-emphasizing weight can change the balance of opposing contributions.
Worked Example: A Weight That Favors Later Times
Using the same hypothetical pooled CIF values, choose \(w(t)=\hat F_1(t-)^2\). This weight is small when little target-cause incidence has accumulated and larger later. Suppose the raw score contributions are \(-0.40\) early and \(0.50\) late.
The early weight is \(0.10^2=0.01\), giving weighted contribution \(0.01(-0.40)=-0.004\). The late weight is \(0.60^2=0.36\), giving weighted contribution \(0.36(0.50)=0.180\). The weighted sum is \(-0.004+0.180=0.176\), compared with the unweighted sum \(-0.40+0.50=0.10\).
The late multiplier is \(0.36/0.01=36\) times the early multiplier. This is a strong late emphasis, not evidence that the late estimate is more precise. In particular, a large late weight cannot compensate for a very small late risk set or unstable follow-up.
Assumptions, Diagnostics, and Limitations
The weighting choice sits inside Gray’s test; it does not remove the conditions needed for the test’s score construction. The comparison assumes independent subjects, correctly classified causes of failure, and censoring that is independent of the event process within groups (or independent conditional on variables appropriately handled in the analysis). There must also be adequate follow-up and modified-risk-set support over the times receiving meaningful weight. The null concerns equality of the target-cause CIFs over the comparison period, not equality of every cause-specific hazard.
Before interpreting a weighted score, check the following:
- Direction and scale: Tabulate or plot the raw \(A_j\) values alongside \(w(t_j)A_j\). This reveals whether the result is driven by a few heavily weighted contributions.
- Risk-set support: Examine how many subjects remain represented in the modified risk sets at emphasized times. Late weights can magnify sparse, unstable contributions.
- Weight behavior: Confirm the weights are nonnegative if the intended interpretation is simple emphasis, and inspect whether they become nearly zero or unusually large.
- Prespecification: Record the weight formula and its parameters before examining group differences. Trying many weights and reporting only the most favorable one invalidates the usual interpretation of a single unadjusted test.
- Censoring and follow-up: Investigate whether censoring patterns or follow-up support differ in ways that make the required censoring assumptions implausible.
A weighted test may have less power than an unweighted test when the true difference occurs at times it downweights. It can also be sensitive to the chosen weight parameters. The score contributions alone cannot determine statistical significance: inference requires an appropriate variance estimate and reference distribution. Weighting is not a substitute for checking the study design, follow-up, or assumptions.
How to Use the Weighting Choice
The main comparison is between a constant-weight Gray score and a weighted Gray score. The constant-weight version does not privilege particular event times; a weighted version can be more sensitive to a planned time pattern but may be less sensitive to other patterns. Unlike choosing a weight to match a scientific alternative, selecting one after viewing the results risks overstating evidence. A separate analysis of time-specific contrasts may help describe when differences appear, but it does not replace a prespecified test or its variance calculation.
Check Your Understanding
Answer each question using the definitions and calculations above.
- If \(A_j=-0.30\) and \(w(t_j)=2\), what is the weighted contribution, and what does its sign mean?
- At two times, the raw contributions are \(0.40\) early and \(-0.50\) late. Calculate the weighted sum using weights \(0.75\) and \(0.25\), respectively.
- For \(w(t)=[1-\hat F_1(t-)]^2\), calculate the weight when the pooled CIF just before the event time is \(0.30\).
- Why is a weight based on \(\hat F_1(t-)\) preferable to one that uses information from the event at \(t\) itself?
- Name one reason a large late weight may be problematic even if late differences are scientifically important.
Solutions. (1) The weighted contribution is \(2(-0.30)=-0.60\); its negative sign means the group 1 observed count is below its modified-risk-set expected count at that time. (2) The sum is \(0.75(0.40)+0.25(-0.50)=0.30-0.125=0.175\). (3) The weight is \((1-0.30)^2=0.70^2=0.49\). (4) The left-limit CIF uses information available just before the event time, so the weight does not depend on the event contribution it multiplies. (5) Late follow-up may have sparse modified risk sets or unstable estimates, so a large multiplier can magnify noisy contributions.