-
Notifications
You must be signed in to change notification settings - Fork 106
Description
The predict() method for censoring_model_reverse_km models has a new_data argument which is passed on to the predict method for prodlim objects. The definition for this arg from prodlim:
A data frame with the same variable names as those that appear on the right hand side of the 'prodlim' formula.
However, the right hand side for censoring_model_reverse_km models is always just 1, no covariates:
parsnip/R/survival-censoring-model.R
Line 27 in 2a8f92e
| km_form <- stats::update(f, ~ 1) |
Because of that, the argument doesn't do anything, you can even feed it a totally unrelated dataset and it won't complain. Do we anticipate adding covariates to that reverse KM anytime soon/ever? If not, can we deprecate that arg to reduce complexity we are not even making use of?
library(censored)
#> Loading required package: parsnip
#> Loading required package: survival
mod_fit <-
survival_reg() %>%
fit(Surv(time, status) ~ age + sex, data = lung)
# can use different data (because reverse_km model uses ~ 1)
pred_newdata <- predict(mod_fit$censor_probs, time = (7:10) * 100,
new_data = mtcars)Created on 2023-05-11 with reprex v2.0.2