Description Usage Arguments Value Author(s) Examples

View source: R/predict_shrinkDSM.R

Draws from the posterior predictive distribution of survival times based on a fitted
time-varying parameter survival model resulting from a call to
`shrinkDSM`

.

1 2 |

`object` |
an object of class |

`newdata` |
a data frame containing the covariates used for the prediction.
The names of the covariates
have to match the names used during model estimation in the call to |

`cens` |
logical value indicating whether the predictions should be censored at the
largest survival time in the data used for estimation.
The default value is |

`...` |
included for S3 method consistency and currently ignored. |

The value returned is a list object of class `shrinkTVP_pred`

containing the
samples from the
posterior predictive density.

Peter Knaus peter.knaus@wu.ac.at

Daniel Winkler dwinkler@wu.ac.at

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
set.seed(123)
data("gastric")
# Create intervals for piecewise exponential model
intervals <- divisionpoints(gastric$time, gastric$status, 2)
# Estimate model
mod <- shrinkDSM(time ~ radiation, gastric,
delta = gastric$status, S = intervals)
# Draw from posterior predictive distribution
newdata <- data.frame(radiation = c(0, 1))
pred <- predict(mod, newdata = newdata)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.