DNbuilder.glm: Shiny code for Dynamic Nomograms

Description Usage Arguments Value Author(s) See Also Examples

Description

DNbuilder.glm 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.

Usage

1
2
DNbuilder.glm(model, data, clevel = 0.95, m.summary = c("raw", "formatted"),
                      covariate = c("slider", "numeric"))

Arguments

model

a glm model object

data

dataframe containing the accompanying data

clevel

confidence level required

m.summary

The option to choose the format of the model output in the 'Summary Model' tab. If "raw" (the default) is chosen the result of summary(model) will be display while if "formatted" is chosen the model summary using the stargazer package will be displayed.

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.

Value

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.

Author(s)

Amirhossein Jalali, Alberto Alvarez-Iglesias, John Newell

See Also

glm, DynNom, DynNom.glm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# a generilized linear model
model1 <- glm(Fertility ~ Agriculture + Education + Catholic, data = swiss)
DNbuilder.glm(model1, swiss, clevel = 0.9)

# a logistic regression model
data1 =as.data.frame(Titanic)
model2 <- glm(Survived ~ Age + Class + Sex, data = data1, weights = Freq,
              family = binomial("probit"))
DNbuilder(model2, as.data.frame(Titanic), clevel = 0.9)

## End(Not run)

if (interactive()) {
# a poisson regression model
model3 <- glm(event ~ mag + dist + accel, data = attenu, family = poisson)
DNbuilder(model3, attenu, covariate = "numeric")
}

amirjll/DynNom-V4.1.1 documentation built on May 10, 2019, 1:17 a.m.