knitr::opts_chunk$set(fig.width=7)
Basic QSurvival functions.
d <- data.frame(lifetime=c(2,1,2),censored=c(FALSE,FALSE,TRUE)) print(d)
d2 <- QSurvival::buildQuasiObsForTraining(d,d$lifetime,ifelse(d$censored,NA,d$lifetime), 'origRow','sampleAge','deathEvent') print(d2)
QSurvival::buildQuasiObsForComparison(d,5,d$lifetime,ifelse(d$censored,NA,d$lifetime), 'origRow','sampleAge','deathEvent')
QSurvival::buildQuasiObsForApplication(d,5,'origRow','sampleAge')
d2$hazardPred <- 0.1 QSurvival::summarizeHazard(d2,'origRow','sampleAge','hazardPred', survivalColumnName='survival', deathIntensityColumnName='deathIntensity')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.