Tutorials › Competing Risks and Multi-State Models › An Approximate Sample-Size Calculation

Testing and Design · Tutorial 225 of 699

An Approximate Sample-Size Calculation

Learn how to turn specified cumulative-incidence alternatives into an approximate total sample size for a two-group Gray test, and when that calculation needs refinement.

Advanced 12 min read

What You'll Learn

  • Express a Gray-test design alternative through its expected score drift and variance.
  • Derive the approximate sample-size formula from a two-sided power calculation.
  • Distinguish cumulative-incidence curves from the additional inputs needed to calculate Gray-test power.
  • Calculate and round total sample sizes for specified power and type I error.
  • Diagnose when a normal-approximation sample size may be unreliable.

From Cumulative Incidence Alternatives to Sample Size

A design calculation asks how many participants are needed for a planned test to detect a specified difference with a chosen probability. For competing risks, the scientific alternative is usually described by the cause-specific cumulative incidence functions (CIFs), not by a difference in ordinary event-free survival. But a Gray test uses event times and weighted risk sets across follow-up, so its power cannot generally be calculated from the two CIF values at a single time alone.

This tutorial develops a normal-approximation calculation for a two-group Gray test with equal or nearly equal allocation. The calculation translates the planned CIF curves, competing-event distributions, censoring, and Gray-test weighting into an expected score drift and a variance. It then uses those quantities to approximate the total sample size. The introductory material on competing-event incidence and test power provides context for why the alternative and follow-up pattern matter.

Definition: Let \(U_N\) be the one-degree-of-freedom Gray score for \(N\) independent participants, using the prespecified test weights and target cause. Write \(a\) for its expected score drift per participant under the design alternative and \(v\) for its null variance per participant. In the usual large-sample approximation, \(E(U_N)\approx Na\) under the alternative and \(\operatorname{Var}_0(U_N)\approx Nv\) under the null. The scale of \(a\) and \(v\) depends on the chosen score normalization, but the ratio \(v/a^2\) does not if the same normalization is used for both.

The null hypothesis for the two-group Gray test is equality of the target-cause CIFs over the tested follow-up, with the specified test weights. The test does not require proportional cause-specific hazards. Its score nevertheless reflects the timing of target events, competing events, censoring, and the risk sets that enter the test. Consequently, \(a\) and \(v\) must be calculated for the planned design and the same Gray-test specification that will be used in the analysis.

Deriving the Approximate Formula

Under the null, the standardized score \(Z=U_N/\sqrt{Nv}\) is approximately standard normal for a sufficiently large sample. Under the alternative, use the null variance for the score-test approximation. The score’s approximate mean then gives

$$ E_1(Z)\approx \frac{Na}{\sqrt{Nv}} =\frac{\sqrt{N}\,a}{\sqrt{v}}. $$

For a two-sided test at significance level \(\alpha\), let \(c=z_{1-\alpha/2}\), where \(z_q\) is the \(q\) quantile of the standard normal distribution. If the alternative produces positive score drift, the principal rejection-tail probability is approximately \(P(Z>c)\). To obtain power \(1-\beta\), set the alternative mean about \(z_{1-\beta}\) standard deviations above \(c\). This gives

$$ \frac{\sqrt{N}\,|a|}{\sqrt{v}} \approx z_{1-\alpha/2}+z_{1-\beta}, \qquad N\approx \frac{\left(z_{1-\alpha/2}+z_{1-\beta}\right)^2v}{a^2}. $$

This is a convenient approximation, not an exact solution to the two-sided power equation. If \(Z\) is approximated by \(N(\mu,1)\) under the alternative, the more complete expression is \(P(Z>c)+P(Z<-c)=1-\Phi(c-\mu)+\Phi(-c-\mu)\), where \(\Phi\) is the standard normal distribution function. The second tail is often small for a planned alternative in one direction. For a final design near a decision threshold, solve the full expression or use a more complete model-based power calculation.

Planning quantities: The inputs \(a\) and \(v\) are not generally the endpoint CIF difference and a binomial variance. They are summaries of the Gray score under the planned alternative and null. Obtain them using the specified alternative CIF curves together with the event-time, competing-event, censoring, follow-up, and score-weight specifications. Use one consistent score normalization.

Assumptions and a Calculation Workflow

The approximation is most useful when the study has two independent groups, a prespecified target cause and Gray weighting rule, and enough expected events for a normal score approximation. For the examples below, allocation is equal or differs by at most one participant; participants are independent; and censoring is independent of event times within group. The planning model specifies the follow-up endpoint and the distribution of competing events as well as the target-cause CIF. These assumptions are design inputs, not conclusions established by the sample-size formula.

1
Specify the test and estimand.
Choose the target cause, Gray-test weighting, follow-up horizon, two-sided \(\alpha\), and desired power. State which group is expected to have the larger target-cause CIF.
2
Specify the design alternative.
Give the target-cause CIF curves by group and enough information about competing events and censoring to determine the score’s expected behavior and variance.
3
Calculate the score inputs.
Use the planned Gray score and risk-set structure to obtain \(a\), the alternative drift per participant, and \(v\), the null variance per participant. Check that both use the same score scale.
4
Calculate and round.
Substitute \(a\), \(v\), \(\alpha\), and \(1-\beta\) into the formula. Round the required total sample size upward, then assign participants as evenly as possible between groups.

Worked Sample-Size Calculations

Worked Example: An 80% Power Design

Hypothetical planning scenario. Investigators plan a two-sided Gray test at \(\alpha=0.05\), with 80% power and approximately equal allocation. The target-cause CIFs at the planned horizon are 0.0800 in Group A and 0.0853 in Group B. The full hypothetical event-time and censoring model, evaluated with the prespecified Gray score, gives \(a=0.005297\) and \(v=0.02750\). Assume independent participants and independent administrative censoring at the common horizon.

The standard normal quantiles are \(z_{0.975}=1.960\) and \(z_{0.80}=0.8416\). The approximate required total sample size is

$$ N\approx \frac{(1.960+0.8416)^2(0.02750)}{(0.005297)^2} = \frac{(2.8016)^2(0.02750)}{0.000028058209} \approx 7692.8. $$

Rounding upward gives 7,693 participants total. An allocation of 3,846 and 3,847 is as close to equal as possible. The difference between the endpoint CIFs is not being substituted for \(a\); \(a\) is the score drift calculated from the full planned curves and risk-set model.

Worked Example: A More Stringent Type I Error and Higher Power

Hypothetical planning scenario. A two-sided design targets \(\alpha=0.01\) and 90% power. The modeled target-cause CIFs at the horizon are 0.120 in Group A and 0.150 in Group B. Under a specified independent censoring model and the chosen Gray weighting, suppose the score calculation gives \(a=0.02131\) and \(v=0.03000\). Participants are independent and allocated nearly equally.

Here \(z_{0.995}=2.576\) and \(z_{0.90}=1.282\). Thus,

$$ N\approx \frac{(2.576+1.282)^2(0.03000)}{(0.02131)^2} = \frac{(3.858)^2(0.03000)}{0.0004541161} \approx 983.3. $$

Round up to 984 participants total, or 492 per group. The required sample is larger than a calculation with a less stringent \(\alpha\) or lower target power would require, all else equal. The CIF values alone do not verify the stated score inputs; those inputs depend on the full hypothetical design model.

Worked Example: Checking a Third Design Calculation

Hypothetical planning scenario. Consider a two-sided test with \(\alpha=0.05\), 80% power, and near-equal allocation. The planned target-cause CIFs at the horizon are 0.040 in Group A and 0.055 in Group B. Suppose the complete event-time and censoring model gives a Gray-score drift of \(a=0.0150\) and null variance per participant \(v=0.0400\). As before, assume independent participants and independent censoring under the specified model.

Using \(z_{0.975}=1.960\) and \(z_{0.80}=0.8416\),

$$ N\approx \frac{(1.960+0.8416)^2(0.0400)}{(0.0150)^2} = \frac{(2.8016)^2(0.0400)}{0.000225} \approx 1395.4. $$

The upward-rounded requirement is 1,396 participants total, or 698 per group. This is a sample-size calculation for the stated score drift and variance, not a rule based only on the 0.015 endpoint CIF difference.

Diagnostics, Alternatives, and Limitations

Before treating a result as a design estimate, check that the inputs actually describe the intended study. In particular, verify the direction and magnitude of the target-cause CIF differences over time, the timing and frequency of competing events, the follow-up horizon, the censoring mechanism, and the exact Gray weighting. Curves that cross may produce partial cancellation in the score, even when their endpoint values differ. A large endpoint CIF difference therefore does not guarantee a large Gray-test drift.

Also check that the planned number of participants implies a plausible number of target events and that the score’s large-sample approximation is credible. If a design model produces very few target events, heavy or group-differential censoring, or a small score drift close to zero, the formula can be unstable or poorly calibrated. A result that changes greatly under small, reasonable changes to the curves or censoring assumptions is a warning to report sensitivity analyses and consider a more detailed power calculation.

ApproachWhat it usesMain limitation
Gray-score normal approximationAlternative score drift \(a\), null variance \(v\), and normal quantilesDepends on adequate large-sample approximation and correctly specified planning inputs
Single-time CIF comparisonTwo group-specific CIF values at a chosen timeDoes not generally reproduce Gray’s time-weighted score or its power
Model-based or simulation-based power calculationSpecified event and censoring processes with the planned test applied to generated or modeled dataRequires more modeling and computational work; inputs and implementation need careful checking

The normal approximation is attractive because it makes the dependence on the target power, type I error, drift, and variance explicit. It is not a substitute for specifying the alternative. CIF curves alone may not determine the event-time and censoring details required for the Gray-score calculation. Nor does this equal-allocation formula address delayed accrual, loss to follow-up beyond the stated censoring model, multiplicity, or a changed testing plan; such features need to be incorporated into the design calculation rather than assumed away.

Common Pitfall

  • Wrong reasoning: “The CIF difference at the final visit is 0.02, so I can put 0.02 in place of \(a\) and use a binomial variance for the Gray test.”
  • Correction: The endpoint difference is a feature of the alternative, but Gray’s test uses weighted event-time information and competing-risk risk sets. Calculate the expected score drift and its variance using the specified full design model; do not treat an endpoint comparison as the Gray test unless that is explicitly the method being planned.
  • Rounding error: Do not round a calculated sample size to the nearest integer when doing so could leave the design below its target. Round upward, then check that the resulting allocation is feasible.
Key takeaway: For a two-sided, approximately equal-allocation Gray-test design, the normal score approximation gives \(N\approx (z_{1-\alpha/2}+z_{1-\beta})^2v/a^2\). Its usefulness depends on obtaining \(a\) and \(v\) from a clearly specified competing-risks and censoring model, not from an endpoint CIF difference alone.

Check Your Understanding

Try the questions first, then compare your reasoning with the brief solutions below.

  1. If \(\alpha\), power, and \(v\) stay fixed while \(|a|\) is cut in half, what happens approximately to the required sample size?
  2. Why are two endpoint CIF values not generally enough to calculate power for Gray’s test?
  3. For a two-sided test at \(\alpha=0.05\) and power 80%, what normal quantiles enter the approximate formula?
  4. A calculation gives \(N=1{,}120.2\). What total sample size should be planned, before assigning participants to groups?
  5. Name two design assumptions or inputs that should be checked before relying on the approximation.

Solutions. (1) Since \(N\) is proportional to \(1/a^2\), halving \(|a|\) multiplies the required sample size by four. (2) Gray’s score depends on event timing, competing events, censoring, risk sets, and the selected weighting, not only on endpoint CIFs. (3) Use \(z_{0.975}=1.960\) and \(z_{0.80}=0.8416\). (4) Round upward to 1,121 participants, then allocate as evenly as possible. (5) Suitable checks include independent participants, the censoring mechanism, the follow-up horizon, the specified competing-event distributions, and whether the expected event count supports a normal approximation.

Clinical Biostats