Nothing
Load the packages we need.
library(Umpire) library(survival)
Create a survival model, and generate data.
sm <- SurvivalModel(baseHazard = 1/5, # default 1/5 inverse years accrual = 5, # default 5 years followUp = 1, # default 1 years units = 12, unitName = "months") R <- rand(sm, 200) summary(R)
Fit a Kaplan-Meier curve.
baseModel <- survfit(Surv(LFU, Event) ~ 1, R) plot(baseModel)
Now create several cancer models and generate data.
for (ignore in 1:5) { for (jgnore in 1:4) { cm <- CancerModel("survtester", nPossible=20, nPattern=2, SURV = function(n) rnorm(n, 0, 2), # old default; too large survivalModel = sm) S <- rand(cm, 200) model <- survfit(Surv(LFU, Event) ~ CancerSubType, S) print(model) plot(model) } }
Now create several cancer models and generate data.
for (ignore in 1:5) { for (jgnore in 1:4) { cm <- CancerModel("survtester", nPossible=20, nPattern=2, SURV = function(n) rnorm(n, 0, 0.3), survivalModel = sm) S <- rand(cm, 200) model <- survfit(Surv(LFU, Event) ~ CancerSubType, S) print(model) plot(model) } }
for (nPos in c(5, 10, 15)) { for (jgnore in 1:4) { cm <- CancerModel("survtester", nPossible=nPos, nPattern=2, SURV = function(n) rnorm(n, 0, 0.3), survivalModel = sm) S <- rand(cm, 200) model <- survfit(Surv(LFU, Event) ~ CancerSubType, S) print(model) plot(model) } }
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.