Skip to contents

Fits a semi-parametric Cox proportional-hazards regression of time-to-event data.

Usage

ertte_coxph(formula, data, ...)

Arguments

formula

Model formula specifying the regression model, e.g. Surv(time, event) ~ exposure.

data

Data frame containing the variables of interest.

...

Other arguments passed to survival::coxph().

Value

A coxph object with with additional ertte_coxph and ertte_model classes used to supply additional methods.

Details

The ertte_coxph() function is a thin wrapper around survival::coxph(), used to build semi-parametric proportional hazard models for time-to-event data. One slight difference is that the call to coxph() always sets model = TRUE, because downstream methods supplied by the ertte package require the model frame to be accessible from within the return object. Along similar lines, ertte_coxph() caches the input data frame within the returned model object, ensuring that it remains accessible to downstream tools that have access to the model object but not necessarily the original data frame.

Because the return value is a coxph object, all the usual methods for survival regression models work unchanged, without needing an ertte-specific equivalent. This includes summary(), coef(), vcov(), confint(), predict(), AIC(), BIC(), logLik(), and anova(). Additional methods supplied via the ertte-specific classes include ertte_predict(), ertte_fun(), and simulate().

Examples

mod <- ertte_coxph(Surv(time, event) ~ aucss, ertte_data)
mod
#> Call:
#> survival::coxph(formula = formula, data = data, model = TRUE)
#> 
#>            coef exp(coef)  se(coef)     z      p
#> aucss 8.859e-04 1.001e+00 7.515e-05 11.79 <2e-16
#> 
#> Likelihood ratio test=110.2  on 1 df, p=< 2.2e-16
#> n= 300, number of events= 232