yoshidk6 / survParamSim

Simulation of Parametric Survival Model with Prediction Intervals
https://yoshidk6.github.io/survParamSim/
3 stars 0 forks source link

Error with `calc_km_pi()` when trt and group has overlapping variables #41

Closed yoshidk6 closed 3 years ago

yoshidk6 commented 3 years ago
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)

yoshidk6 commented 3 years ago

6f453ce