The function takes in a Coxmos model and, based on the specified prediction type (lp
, risk
,
expected
, or survival
), computes the respective predictions. The lp
(linear predictor) is the
default prediction type. The density and histogram plots are then generated to represent the
distribution of events (censored or occurred) concerning these predictions.
The density plot provides a smoothed representation of the event distribution, with separate curves
for censored and occurred events. This visualization can be particularly useful to discern the
overall distribution and overlap between the two event types.
The histogram, on the other hand, offers a binned representation of the event distribution. Each
bin's height represents the count of observations falling within that prediction range, stacked by
event type. This visualization provides a more granular view of the event distribution across
different prediction values.
It's imperative to note that the models should be run with the returnData = TRUE
option to ensure
the necessary data is available for plotting.