Description Usage Arguments Value Author(s) References See Also Examples
DNbuilder
is a generic function to build dynamic nomograms and provide the required scripts for deploying them on a server on the web such as the http://shinyapps.io. DNbuilder
supports lm
, glm
, coxph
model objects.
1 2 3 |
model |
an |
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 |
This plot type option relates to coxph objects only. 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
Banks, J. 2006. Nomograms. Encyclopedia of Statistical Sciences. 8.
Easy web applications in R. http://shiny.rstudio.com
lm, glm, coxph, DynNom, DynNom.lm, DynNom.glm, 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 28 | ## Not run:
# simple linear regression models
model1 <- lm(uptake ~ Plant + conc + Plant * conc, data = CO2)
DNbuilder(model1, CO2)
# Generalized regression models
data1 =as.data.frame(Titanic)
model2 <- glm(Survived ~ Age + Class + Sex, data = data1, weights = Freq,
family = binomial("probit"))
DNbuilder(model2, data1, clevel = 0.9)
# a proportional hazard model
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")
model3 <- coxph(Surv(time, status) ~ age + sex + disease, data.kidney)
DNbuilder(model3, data.kidney)
DNbuilder(model3, data.kidney, ptype = "1-st")
## End(Not run)
if (interactive()) {
# a poisson regression model
model4 <- glm(event ~ mag + station + dist + accel, data = attenu, family = poisson)
DynNom(model4, attenu, covariate = "numeric")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.