DynNom.lm: Dynamic Nomograms for Linear Models

Description Usage Arguments Value Author(s) See Also Examples

Description

DynNom.lm displays the results of an lm model object as a dynamic nomogram in an 'RStudio' panel or web browser.

Usage

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

Arguments

model

an lm 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 dynamic nomogram in a shiny application which recognises all the predictors in the model and uses them to build a sidebar panel. It sets up drop down menus for factors and sliders set at the mean and bounded by the range for covariates.

The individual predictions with a relative confidence interval are calculated using the predict function, displaying either graphically as an interactive plot in the Graphical Summary tab or a table in the Numerical Summary tab. A table of model output is also available in the Model Summary tab.

Author(s)

Amirhossein Jalali, Alberto Alvarez-Iglesias, John Newell

See Also

lm, predict.lm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# a linear regression model
model1 <- lm(Fertility ~ Agriculture + Education + Catholic , data = swiss)
DynNom(model1, swiss)

model2 <- lm(uptake ~ Plant + conc + Plant * conc, data = CO2)
DynNom(model2, CO2)

## End(Not run)

if (interactive()) {
data1 <- data.frame(state.x77)
fit1 <- lm(formula = Life.Exp ~ ., data = data1)
DynNom(fit1, data1)
}

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