DynNom: A Dynamic Nomogram for Linear and Generalized Linear Models...

Description Usage Arguments Details Value Please cite as: Author(s) References See Also Examples

Description

The DynNom function makes it possible to display predicted values of an lm or glm model object as a dynamic nomogram that can be displayed in an R Studio panel or web browser.

Usage

1
DynNom(model, data, clevel = 0.95, covariate = c("slider", "numeric"))

Arguments

model

an lm or glm model object

data

dataframe containing the accompanying data

clevel

confidence level required

covariate

option to choose the value(s) of the covariate(s) using a slider or as a numerical input

Details

This function takes as input a model object created using the lm or glm function (accompanied by the dataset) and automatically generates a dynamic nomogram as a shiny application
Predicted values, and accompanying interval estimates, are calculated using predict.lm or predict.glm functions on the linear scale and then transformed based on the link function used.

Value

A shiny application

Please cite as:

Jalali, A., Alvarez-Iglesias, A., Newell, J. (2014). A Dynamic Nomogram for Linear and Generalized Linear Models as Shiny Applications. R package version 1.0.

Author(s)

Amirhossein Jalali, Alberto Alvarez-Iglesias, John Newell

References

Levens, A. S. Nomography (2nd Edition). Fearon Publishers, Belmont, CA, USA, 1971. Banks, J. 2006. Nomograms. Encyclopedia of Statistical Sciences. 8.
Easy web applications in R. http://shiny.rstudio.com

See Also

glm, predict.lm, predict.glm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# a simple linear regression model
model1 <- lm(uptake ~ Plant + conc + Plant * conc, data = CO2)
DynNom(model1, CO2)

# a logistic regression model
swiss$ftl <- as.numeric(swiss$Fertility > 70)
model2 <- glm(ftl ~ Agriculture + Education + Catholic, data = swiss, family = binomial)
DynNom(model2, swiss, clevel = 0.9)

## End(Not run)

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

amirjll/DynNom-V1.0 documentation built on May 10, 2019, 1:16 a.m.