Tutorials › Competing Risks and Multi-State Models › A Worked Gray-Test Trial Design

Testing and Design · Tutorial 237 of 699

A Worked Gray-Test Trial Design

Work from a target-cause question to a transparent Gray-test design, including a sample-size calculation, allocation, follow-up schedule, and attrition allowance.

Advanced 12 min read

What You'll Learn

  • State a two-group target-cause cumulative-incidence estimand and its Gray-test null hypothesis.
  • Translate clinically meaningful cumulative-incidence curves into a planning alternative.
  • Calculate approximate sample size from type I error, power, and a calibrated Gray-test signal.
  • Quantify the enrollment cost of unequal allocation and loss to follow-up.
  • Specify accrual and follow-up so the intended analysis horizon is observed.
  • Identify assumptions and planning uncertainties that require sensitivity analysis.

From a Clinical Question to a Testable Design

A trial involving competing events needs to specify which event matters and over what time period. For example, a treatment may be intended to reduce disease-related death by 24 months, while death from another cause prevents that event from occurring. The design should therefore be based on the target cause’s cumulative incidence function (CIF), not on a target-event risk that treats competing events as ordinary censoring.

This tutorial develops one hypothetical two-group design around that question. The primary comparison is a Gray test of the target-cause CIFs. The calculation is approximate: a numerical planning signal must represent the proposed CIF curves, their uncertainty, and the analysis plan. It is not obtained simply by subtracting two CIF values at one time point.

Definition: Let \(F_{g1}(t)\) denote the cumulative incidence by time \(t\) of target cause 1 in group \(g\), where \(g=0\) is control and \(g=1\) is treatment. The two-sided Gray-test null hypothesis is equality of the target-cause CIFs over the specified follow-up period: $$ H_0: F_{01}(t)=F_{11}(t)\ \text{for all }0\leq t\leq \tau, \qquad H_a: F_{01}(t)\neq F_{11}(t)\ \text{for at least one }t\leq\tau. $$ The test compares the group CIFs while accounting for competing events. Its usual large-sample reference distribution under \(H_0\) is chi-square with one degree of freedom for two groups. The test does not require proportional subdistribution hazards, but the power of a planned design depends on the shapes of the CIF curves.

Specify the Alternative Before Calculating Enrollment

The clinical question determines the target cause, the time horizon \(\tau\), and what difference would matter. A design alternative should describe the anticipated CIF trajectories, not just a single hazard ratio. For example, the treatment could lower target-cause incidence throughout follow-up, produce a delayed difference, or have curves that cross. Curves that cross can yield a small overall test signal even when their separation is substantial during part of follow-up.

The hypothetical alternative below is intended to illustrate the design process. The values are planning assumptions, not observations from a real study. They describe target-cause and competing-event probabilities at two times; the complete planning alternative would specify the event-time pattern between those times as well.

GroupTarget cause by 12 monthsCompeting event by 12 monthsTarget cause by 24 monthsCompeting event by 24 months
Control0.120.080.240.17
Treatment0.100.100.190.20

At 24 months, the target-cause CIF difference is \(0.19-0.24=-0.05\), or 5 percentage points lower in the treatment group. The competing-event CIF is higher in treatment in these assumptions. This matters: the target-cause CIF is a probability in the presence of competing events, and the treatment contrast in that CIF need not equal a contrast in a cause-specific hazard.

Worked Example: Turning the Clinical Aim Into an Alternative

Suppose the trial aims to compare treatment with control for the cumulative incidence of disease-related death through 24 months. Non-disease death precludes disease-related death. State the primary estimand and interpret the planning difference.

The estimand is the treatment-versus-control difference between the cause-1 CIFs at the prespecified horizon, \(F_{11}(24)-F_{01}(24)\), with the full curves through 24 months informing the Gray test. From the table, the 24-month difference is $$ 0.19-0.24=-0.05. $$ Thus the assumed treatment CIF is 5 percentage points lower at 24 months. This is a design alternative, not a claim that treatment causes the reduction. The test uses the curves over follow-up, so the table’s two time points alone do not fully determine its power.

The competing-event probabilities are also part of the assumed data-generating scenario. They should not be removed from the planning model by treating non-disease death as if the person could still later experience disease-related death.

Power Approximation and Sample Size

For a transparent approximate calculation, summarize the planning alternative by a calibrated signal \(d\). In this illustration, \(d=0.115\) is defined so that the standardized Gray-test statistic has approximate mean \(\sqrt{N}d\) under the alternative when the total analyzable sample size is \(N\), allocation is 1:1, and the stated follow-up and censoring assumptions hold. The value is assumed to have been obtained from a model-based calculation using the full planning curves and the variance appropriate to the test. It is not the 5-percentage-point CIF difference in the table.

With a two-sided type I error rate \(\alpha\), the normal approximation rejects when the absolute standardized statistic exceeds \(z_{1-\alpha/2}\), the corresponding standard normal quantile. Under the alternative, approximate power is the probability of falling in either rejection tail. For a positive signal \(\delta=\sqrt{N}d\), this is:

$$ \operatorname{Power}(N)\approx \Phi\!\left(\sqrt{N}d-z_{1-\alpha/2}\right) +\Phi\!\left(-\sqrt{N}d-z_{1-\alpha/2}\right). $$

The second term is the opposite tail. It is often very small for a useful design, but it is part of the two-sided power calculation. Solving approximately for the sample size that gives target power \(1-\beta\), while neglecting that small opposite-tail term, gives:

$$ N\approx \frac{\left(z_{1-\alpha/2}+z_{1-\beta}\right)^2}{d^2}. $$

This approximation is a planning tool, not a universal closed-form formula for the Gray test. Its validity depends on how \(d\) was calibrated and on whether the simulated or model-based alternative reflects the intended design.

Worked Example: Analyzable Sample Size and Power

Use the hypothetical planning signal \(d=0.115\), two-sided \(\alpha=0.05\), and target power 0.90. Assume 1:1 allocation and the follow-up and censoring pattern used to calibrate \(d\).

The normal quantiles are \(z_{0.975}=1.960\) and \(z_{0.90}=1.282\). The approximate required analyzable total is $$ N\approx\frac{(1.960+1.282)^2}{0.115^2} =\frac{10.507}{0.013225} \approx 794.5. $$ Rounding upward gives 795 analyzable participants. To provide a small margin for rounding, suppose the design adopts \(N=796\), or 398 analyzable participants per group.

For this adopted total, the unrounded normal mean is $$ \delta=\sqrt{796}(0.115)\approx 3.24455. $$ The approximate two-sided power is therefore $$ \Phi(3.24455-1.95996)+\Phi(-3.24455-1.95996) \approx \Phi(1.28459)+\Phi(-5.20451) \approx 0.9005. $$ The opposite-tail probability is negligible at the displayed precision. If the rounded intermediate value \(1.285\) is used instead, \(\Phi(1.285)\approx0.9006\); the value 0.9005 above retains the unrounded inputs. Both express power of about 90.1%, not a probability that the null hypothesis is true.

Allocation, Accrual, and Follow-Up

Equal allocation is efficient when group-specific costs and recruitment rates are similar. If \(r=n_1/n_0\) is the treatment-to-control allocation ratio and the total analyzable sample size is \(N=n_0+n_1\), the usual two-group information factor relative to 1:1 allocation is \(4r/(1+r)^2\). Under the same approximate signal model, the signal becomes \(\sqrt{N}d\sqrt{4r/(1+r)^2}\). Thus, unequal allocation generally requires more total participants to retain the same power.

Worked Example: Cost of a 2:1 Allocation

Suppose recruitment or treatment availability leads to a planned ratio of two treatment participants per control participant, so \(r=2\). The information factor is $$ \frac{4r}{(1+r)^2}=\frac{8}{9}\approx0.8889. $$ To retain the information of 796 analyzable participants under 1:1 allocation, the approximate total becomes $$ N_{\text{2:1}}\approx796\left(\frac{9}{8}\right)=895.5. $$ Round up to 896 analyzable participants, allocated approximately 597 to treatment and 299 to control. This is more than 796 total participants; adding treatment participants does not fully replace the information lost by having fewer controls.

The analysis horizon also determines the study calendar. A participant enrolled near the end of accrual must have enough opportunity to contribute follow-up through the intended horizon. Administrative censoring at a common database-lock date can otherwise produce less follow-up for later entrants than the design assumed.

Worked Example: Setting Accrual and the Analysis Date

Suppose the 1:1 design requires 796 analyzable participants, accrual is planned uniformly over 18 months, and the primary horizon is 24 months after each participant’s enrollment. The last enrollee must be followed for 24 months before the primary analysis. Therefore, the minimum planned calendar duration from first enrollment to that analysis is \(18+24=42\) months.

At the analysis date, the earliest enrollee could have about 42 months of follow-up, while the latest has 24 months. The primary CIF comparison should use the prespecified follow-up window through 24 months. Longer observation on early enrollees does not compensate for insufficient follow-up among later entrants if the intended estimand is through 24 months for everyone.

Allowing for Loss to Follow-Up and Checking Assumptions

If some participants are expected to be lost before contributing the planned follow-up, enrollment must exceed the analyzable target. Under a simple planning assumption that a fraction \(q\) is lost and losses are similar across groups, the expected retained fraction is \(1-q\), giving the basic inflation \(N_{\text{enroll}}=N_{\text{analyzable}}/(1-q)\). This is an expected-count calculation; it does not guarantee that the realized number retained will meet the target.

For the worked design, assuming 10% loss gives $$ \frac{796}{1-0.10}=884.4. $$ Thus at least 885 participants are needed by this simple calculation. To preserve equal allocation, enrolling 886 (443 per group) is convenient. Under 10% loss, the expected number retained is \(886(0.90)=797.4\), or 398.7 per group on average. If meeting the analyzable target with a specified probability is important, enrollment should be chosen using a binomial retention calculation or simulation rather than relying only on the expected count.

The calculation requires assumptions that should be checked against historical information and the trial protocol. Event causes must be classified consistently; censoring should be independent of the event process within the groups or design strata under the analysis assumptions; and the planned event-time and competing-event patterns should be plausible. If loss to follow-up differs by group or is related to prognosis, simple inflation may not protect power or validity. The chosen signal \(d\) also depends on the full CIF shapes, allocation, accrual, censoring, and analysis horizon.

When these assumptions are uncertain, evaluate a range of plausible alternatives. In particular, examine lower target-cause incidence, higher competing-event incidence, different censoring, and delayed or crossing CIF differences. Simulation is useful when the analytic approximation does not capture the proposed event-time patterns or study calendar. A pointwise CIF difference is not a substitute for this analysis.

What the Design Does—and Does Not—Guarantee

A Gray-test design targets a comparison of cumulative incidence in the presence of competing events. It does not directly test equality of cause-specific hazards, and its result should not be described as a causal effect unless the trial design and analysis support that interpretation. A cause-specific hazard analysis or a model for subdistribution hazards may answer a different question and can be useful as a complementary analysis, but neither should be silently substituted for the prespecified CIF question.

The design is only as credible as its assumptions about the alternative and follow-up. If the actual curves cross, or if the treatment effect is delayed relative to the planning curves, the realized power may differ materially from the nominal calculation. The test’s type I error control is a property of the specified testing procedure under its assumptions; power is conditional on the alternative and the design inputs. A sample-size number is therefore not a guarantee of a significant result.

Key takeaway: A defensible Gray-test trial design connects four items: a clinically defined target-cause CIF question and horizon; plausible full alternative curves; a power calculation calibrated to those curves and the planned analysis; and enrollment plus follow-up sufficient to observe the intended outcomes despite unequal allocation, administrative censoring, and loss to follow-up.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. At 24 months, the assumed target-cause CIFs are 0.24 in control and 0.19 in treatment. What is the treatment-minus-control contrast, and why does it not by itself determine Gray-test power?
  2. With \(d=0.115\), \(N=796\), and \(z_{0.975}=1.960\), what is the approximate standardized mean under the alternative and the dominant-tail contribution to two-sided power?
  3. What is the information factor for a 2:1 allocation, and approximately how many analyzable participants preserve the information of 796 under 1:1 allocation?
  4. If the required analyzable total is 796 and expected loss to follow-up is 10%, what is the simple enrollment inflation? What limitation does it have?
  5. Why should accrual lasting 18 months be followed by 24 months after the last enrollee for an analysis based on a 24-month horizon?

Solutions. (1) The contrast is \(0.19-0.24=-0.05\), a 5-percentage-point lower treatment CIF; power also depends on the curves over time, their variance, and censoring. (2) \(\sqrt{796}(0.115)\approx3.24455\), so the dominant tail is \(\Phi(3.24455-1.95996)=\Phi(1.28459)\approx0.9005\); the opposite tail is negligible. (3) The factor is \(8/9\); \(796(9/8)=895.5\), so round up to 896. (4) \(796/0.90\approx884.4\), so 885 by the simple calculation; this controls only expected retention, not the probability of retaining at least 796. (5) The last enrollee needs a full 24 months to contribute the intended horizon, so 18 months of accrual plus 24 months of post-accrual follow-up gives 42 months to the primary analysis.

Clinical Biostats