library(survival)
library(survParamSim)
fit.lung <- survreg(Surv(time, status) ~ sex + ph.ecog, data = lung)
sim <- surv_param_sim(fit.lung, lung, 30, c(200, 1100))
#> Warning in surv_param_sim(fit.lung, lung, 30, c(200, 1100)): Not all subjects in
#> `newdata` will be used for `surv_param_sim`, likely because NA is present
km.pi <- calc_km_pi(sim, group = c("sex", "ph.ecog"), trt = "sex")
#> Error: Column name `sex` must not be duplicated.
#> Use .name_repair to specify repair.
Created on 2021-07-19 by the reprex package (v0.3.0)