gcefg: Generalized competing event model via Fine-Gray regression

View source: R/gcefg.R

gcefgR Documentation

Generalized competing event model via Fine-Gray regression

Description

Fits a generalized competing event (GCE) model on the subdistribution hazard scale and estimates covariate effects on \tilde\omega^{+} using a Lunn-McNeil-style stacked Fine-Gray model (see lunnmcneil with type = "finegray"), giving confidence intervals, Wald tests, and an omnibus test from one joint model. A GCE risk score is formed from the model linear predictor.

Usage

gcefg(formula, ...)

## S3 method for class 'formula'
gcefg(
  formula,
  data,
  subset,
  na.action,
  t = NULL,
  event = NULL,
  competing = NULL,
  conf.level = 0.95,
  standardize = FALSE,
  se = c("robust", "boot"),
  B = 200,
  contrasts = NULL,
  model = TRUE,
  ...
)

## Default S3 method:
gcefg(
  formula,
  Ind,
  Cov,
  M = NULL,
  t = NULL,
  conf.level = 0.95,
  standardize = FALSE,
  se = c("robust", "boot"),
  B = 200,
  ...
)

Arguments

formula

a formula with a Surv(time, status) response (formula method), or the numeric vector of follow-up times (default method, where it may also be named Time).

...

passed to coxph for the stacked model.

data

a data frame in which the formula is evaluated.

subset, na.action

as in model.frame.

t

default readout time for time-dependent quantities. If NULL (default), the largest observed event time is used.

event, competing

code (or factor level) marking the event of interest and the competing event; see lunnmcneil.

conf.level

confidence level (default 0.95).

standardize

logical; controls only the reported omega+ ratio scale (default FALSE = per natural covariate unit; TRUE = per 1 SD). The risk score is always the normalized (mean-centered) linear predictor regardless of this setting, so cutpoints, plots, and calibration are unaffected. Covariate means/SDs are returned by gce_scaling.

se

standard-error method passed to lunnmcneil: "robust" (default; cluster-robust on subject, censoring weights treated as fixed, which errs on the conservative side) or "boot" (subject bootstrap that re-estimates the censoring weights within each resample, so the variance additionally accounts for their estimation, at higher computational cost).

B

number of bootstrap resamples when se = "boot" (default 200).

contrasts

optional contrasts specification passed to model.matrix.

model

logical; keep the model frame in the fitted object (default TRUE).

Ind

(default method) a data frame of event indicators. Column 1 = event of interest, column 2 = competing event (0/1).

Cov

(default method) a data frame of covariates.

M

deprecated and ignored. The number of bins is now an argument of the displays (plot(fit, which = "riskscore", bins = ), gce_calibration).

Details

The interface, the role of t, and the returned object are as for gcecox. Predicted absolute \tilde\omega^{+}(t) values are obtained from two separate Fine-Gray fits (crr), stored as $fit1 and $fit2.

Value

An object of class c("gcefg", "gcemod") with the same components and methods as a gcecox fit, on the subdistribution scale; see gcemod-methods.

See Also

gcecox, lunnmcneil, gcemod-methods

Examples

data(hn)
fit <- gcefg(Surv(time, status) ~ age + smoker + p16, data = hn, t = 5)
summary(fit)

gcemod documentation built on Dec. 1, 2026, 1:06 a.m.