Fit a standard (unweighted) Cox proportional hazards model
Source:R/single-event.R
get_cox_fit_se.RdConvenience wrapper around survival::coxph() using counting-process
(tstart, tstop) time variables. Returns log-hazard ratio estimates with
standard errors and the hazard ratio with 95% confidence
intervals.
Value
A data frame with one row per term containing:
- term
Covariate name.
- log_hr
Log hazard ratio estimate.
- log_hr_se
Standard error of the log hazard ratio.
- hr
Hazard ratio estimate.
- hr_ci_low
Lower 95% confidence limit.
- hr_ci_high
Upper 95% confidence limit.
Examples
set.seed(20240429)
dat <- sim_data_se(n = 500)
dat_long <- get_ipcw_wgt_se(dat)
get_cox_fit_se(dat_long)
#> # A tibble: 1 × 6
#> term log_hr log_hr_se hr hr_ci_low hr_ci_high
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 x -1.85 0.147 0.157 0.117 0.209