gce_tidy: Tidy a GCE model into a data frame of estimates

View source: R/methods.R

gce_tidyR Documentation

Tidy a GCE model into a data frame of estimates

Description

With effects = FALSE (the default) the omega+ ratio estimates are returned. With effects = TRUE a covariate-effects comparison table is returned that juxtaposes, for each covariate, the hazard ratio for the primary (event-of-interest) hazard, the competing-event hazard, the total (composite, any-event) hazard, and the relative hazard ratio (the omega+ ratio) from the GCE model, each with a confidence interval. This lets the investigator see whether a covariate acts mainly on the event of interest, the competing event, both, or on their balance.

Usage

gce_tidy(object, effects = FALSE, ...)

Arguments

object

a "gcemod" object from gcecox, gcefg, or gcecif. For a gcecif fit the relative column is the cumulative-incidence ratio (rho ratio) and the primary/competing/total columns are cause-specific hazard ratios.

effects

logical; if TRUE, return the primary/competing/total/ relative effects comparison table instead of the omega+ ratio table. Requires an object fit with gcemod >= 0.3.0 (which stores the design matrix). Default FALSE.

...

unused.

Details

The individual- and total-event columns are estimated on the same hazard scale as the fitted model: cause-specific Cox models for a gcecox fit, and Fine-Gray subdistribution models for a gcefg fit. The total (composite) event has no competing event, so its subdistribution and cause-specific hazards coincide and a Cox model on the composite endpoint is used in both cases.

Value

If effects = FALSE, a data frame with columns term, log_ratio, ratio, conf.low, conf.high, p.value. If effects = TRUE, a data frame with columns term, primary, competing, total, and relative, each a formatted "HR (low, high)" string.

Examples

data(hn)
fit <- gcecox(Surv(time, status) ~ age + t_cat + p16, data = hn, t = 5)
gce_tidy(fit)
gce_tidy(fit, effects = TRUE)

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