-
Notifications
You must be signed in to change notification settings - Fork 31
IPCW article #282
base: main
Are you sure you want to change the base?
IPCW article #282
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more small edits as suggestions 😄
|
||
- Observed time: time recorded in the data | ||
- Event time: observed times for actual events | ||
- Evaluation time: the time, specified by the analyst, that the model is evaluated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be "that the model is evaluated at"? or maybe "evaluated for"? 🤔
Todo:
|
- **Category 1 - Events**: Evaluation time is greater than or equal to the event time ("it has already happened"). | ||
- **Category 2 - Non-events**: Evaluation time is less than the observed time, censored or not ("nothing has happened yet"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the "definitive" qualifier here since we then go on to add a probability for that and that feels somewhat "off" to "definitive".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another important change: I've flipped the language and now describe it in terms of evaluation time relative to observed time since evaluation time is the thing we are varying and the observed time is fixed.
geom_vline(aes(xintercept = eval_time, col = I("red"), linetype = I("dashed"), linewidth = I(0.8))) + | ||
geom_point(aes(eval_time, obs_id, shape = eval_status, col = I("red"), size = I(5))) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not figured out in justifiable time how to get the red into the legend. Accept that small mismatch or go back to all black?
not using `.time_as_binary_event()` since that requires a single value for eval_time
binary_encoding <- | ||
dyn_val_pred %>% | ||
mutate( | ||
obs_class = time_as_binary_event(event_time, .eval_time), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.time_as_binary_event()
from parsnip wants eval_time
as a single numeric value, to use that it would have to be something like this:
binary_encoding <-
dyn_val_pred %>%
rowwise() %>%
mutate(
obs_class = .time_as_binary_event(event_time, .eval_time),
) %>%
ungroup() %>%
mutate(
pred_class = if_else(.pred_survival >= 1 / 2, "non-event", "event"),
pred_class = factor(pred_class, levels = c("event", "non-event")),
)
So if we want to remove the function definition here and use the parsnip version, we might want to consider tweaking that one first. The above code block feels pretty heavy on the friction.
I'll leave this as draft until the other articles are also drafted.