Description Usage Arguments Value Author(s) See Also Examples
DNbuilder.coxph
provides required scripts to deploy an lm
model object as a dynamic nomogram on a server on the web such as the http://shinyapps.io.
1 2 3 | DNbuilder.coxph(model, data,
clevel = 0.95, covariate = c("slider", "numeric"),
ptype = c("st", "1-st"))
|
model |
a coxph model object |
data |
dataframe containing the accompanying data |
clevel |
confidence level required |
covariate |
The option to choose the type of covariate(s) input control widget for numeric values. If "slider" (the default) is chosen a shiny application with slider control widgets are used while if "numeric" is chosen numeric values input controls will be displayed. |
ptype |
If "st" (the default) is chosen, a plot of the estimated survivor function, S(t), is displayed. If "1-st" is chosen a plot of 1- S(t) is displayed. |
A new folder in the current working directory called DynNomapp which contains all the required scripts to deploy this dynamic nomogram on a server on the web such as the http://shinyapps.io. This folder includes ui.R
, server.R
and global.R
script files needed to build the application and dataset.rds
which is the accompanying dataset and a user guide text file called README.txt
which explains how to deploy the app using all these objects.
Amirhossein Jalali, Alberto Alvarez-Iglesias, John Newell
coxph, DynNom, DynNom.coxph
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
data.kidney <- kidney
# always make sure that the categorical variables are in a factor class
data.kidney$sex <- as.factor(data.kidney$sex)
levels(data.kidney$sex) <- c("male", "female")
model1 <- coxph(Surv(time, status) ~ age + sex + disease, data.kidney)
DNbuilder(model1, data.kidney)
DNbuilder(model1, data.kidney, ptype = "1-st")
# a cox model including a strata term
data(lung)
model2 <- coxph(Surv(time, status) ~ age + strata(sex) + ph.ecog , data = lung)
DNbuilder(model2, lung)
## End(Not run)
if (interactive()) {
data.ovary <- ovarian
data.ovary$resid.ds <- as.factor(data.ovary$resid.ds)
levels(data.ovary$resid.ds) <- c("no", "yes")
data.ovary$rx <- as.factor(data.ovary$rx)
data.ovary$ecog.ps <- as.factor(data.ovary$ecog.ps)
model3 <- coxph(Surv(futime, fustat) ~ age + resid.ds * rx + ecog.ps, data = data.ovary)
DNbuilder.coxph(model3, data.ovary)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.