Skip to content

Deprecate new_data arg for reverse_km censoring model #965

@hfrick

Description

@hfrick

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:

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

Metadata

Metadata

Assignees

Labels

upkeepmaintenance, infrastructure, and similar

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions