Description Usage Arguments Details Value Please cite as: Author(s) References See Also Examples
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.
1 |
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 |
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.
A shiny application
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.
Amirhossein Jalali, Alberto Alvarez-Iglesias, John Newell
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
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")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.