Statistics & probability

Gray competing risks test calculator for cumulative incidence curves

Compare two cumulative-incidence curves for an event of interest using the unstratified Gray rho=0 score and its martingale variance.

Your numbers

One row per subject: positive time,0 censored/1 event of interest/2 competing event, group 0 or 1.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Compare two cumulative-incidence curves for an event of interest using the unstratified Gray rho=0 score and its martingale variance.

THE FORMULAχ²=U²/Var(U); rho=0 gives equal pooled subdistribution-survival weighting.

A worked example

The default two seven-subject groups give score 0.7356266, variance 1.2847449, Gray statistic 0.4212093 and asymptotic p≈0.5163342.

Good to know

6–400 rows: positive time, status 0 censored/1 interest/2 competing, group 0/1. At least 3 subjects and an interest event per group. Independent noninformative right censoring within groups; rho 0 only, chi-square 1 approximation. No covariates, strata, exact small-sample test or causal conclusion.

The event of interest has competitors

A cumulative-incidence curve describes the probability of experiencing a specified event by time t when other events can prevent it. A competing event is therefore not merely an ordinary censoring observation. Treating it that way and applying a standard survival complement estimates a different quantity.

Gray's test compares cumulative-incidence functions across groups. This page handles two independent groups and one designated event of interest. All competing event types are represented together by status two, while status zero indicates ordinary right censoring and status one the event being compared.

Default cumulative-incidence historiesBlue: group0 · Green: group1Gray χ² ≈ 0.421209; p ≈ 0.516334
Scroll across to see the full diagram.
Group-specific cumulative incidences evolve at events of interest; competing failures remain part of the calculation.

Compare this with the Fine Gray competing risks regression calculator with covariates. Compare cause-specific cumulative incidence curves across groups without fitting covariate regression coefficients.

Preparing event times and group labels

Each row contains a positive observation time, a status and a group coded zero or one. Time units must be consistent. The implementation sorts times internally and processes tied failures together; input row order should not determine the statistic or decide which subject is removed first.

At least three subjects and an event of interest are required in each group, but that numerical minimum does not make the asymptotic approximation reliable for every small sample. The source model also assumes independent, noninformative right censoring within groups. Those assumptions cannot be verified from row formatting alone.

The default two-group calculation

The example includes seven subjects per group, with events of interest, competing failures and censoring in both groups. Their final estimated cumulative incidences differ, but the test does not compare only those final endpoints. It accumulates a score across the observed event-time history.

The returned score is approximately zero-point-seven-three-five-six-three and its variance about one-point-two-eight-four-seven-four. Squaring the score and dividing by that variance gives about zero-point-four-two-one-two-one. The corresponding one-degree-of-freedom chi-square tail probability is about zero-point-five-one-six-three-three.

How the weighted risk comparison works

Ordinary risk sets remove subjects after any observed failure. A subdistribution comparison must also account for the influence of competing failures on the cumulative incidence of the event of interest. Gray's construction combines group-specific all-cause survival information with weighted subdistribution risk contributions.

The rho parameter controls an additional pooled-survival weighting family. This implementation fixes rho at zero and does not offer an unexplained menu of alternative weights. The history table exposes risk counts, interest and competing event increments, cumulative incidences and the accumulated score at processed failure times.

Why the variance is not a simple binomial variance

The score terms depend on estimated survival and incidence quantities across time. Their uncertainty and covariance enter the martingale variance calculation. Substituting the final cumulative incidences into an independent two-proportion formula would ignore that time-dependent structure and produce another test.

The implementation was compared against the original cmprsk Fortran calculation on independent generated datasets, including tied event times. That reference comparison validates this specific two-group rho-zero algorithm; it does not extend the page to arbitrary strata, regression adjustment or every possible weighted competing-risk procedure.

Reading a non-significant result

A large p-value indicates that the chosen test did not find strong evidence against equal cumulative-incidence functions under its assumptions. It is not a proof that the curves are equal or that a practically important difference is absent. Power and follow-up duration affect what can be detected.

The statistic also does not identify a causal treatment effect. Group allocation, censoring, competing-event mechanisms and covariate differences may all matter. If covariate-adjusted associations are the intended question, a suitable competing-risk regression model is a different analysis from this unadjusted comparison.

Checks and reporting conventions

Swapping group labels changes the score sign but should preserve its square, variance and p-value. Multiplying all times by one positive constant should preserve their ordering and the test. Removing the competing-event label or recoding those failures as censoring changes the mathematical question and should not be used as a compatibility shortcut.

Report the designated event, competing-event coding, rho choice and asymptotic inference method. Inspect the incidence histories as well as the headline statistic. The page rejects zero or unresolved score variance instead of reporting a p-value from division by a degenerate estimate.

A few questions, answered

Is a competing event censored?

Not in this test. Status 2 represents a competing failure and enters the subdistribution calculation differently from ordinary censoring.

Is this Fine–Gray regression?

No. It is an unadjusted two-group Gray comparison with rho 0, not a covariate regression fit.

Does p>0.05 prove equal curves?

No. Failure to reject is not evidence of equivalence or of adequate power to detect every relevant difference.

Are alternative rho weights available?

No. This bounded page implements and validates the rho 0 convention only.

Find your calculator

Start typing to explore the library.