Description Usage Arguments Value Author(s) See Also Examples
codeDynNom.ols displays the results of an ols
model object from the rms
package as a dynamic nomogram in an 'RStudio' panel or web browser.
1 2 | DynNom.ols(model, data,
clevel = 0.95, covariate = c("slider", "numeric"))
|
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. |
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.
Davood Roshan, Amirhossein Jalali, Alberto Alvarez-Iglesias, John Newell
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 | ## Not run:
# example 1
x1 <- runif(200)
x2 <- runif(200)
x3 <- runif(200)
x4 <- runif(200)
y <- x1 + x2 + rnorm(200)
data = data.frame(x1, x2, x3, x4, y)
f <- ols(y ~ rcs(x1, 4) + x2 + x3 + x4)
DynNom.ols(f, data)
# example 2
data1 = as.data.frame(Titanic)
year <- sample(c(1:5), 32, replace = TRUE)
data <- data.frame(year, data1)
model <- ols(year ~ Age + Class + Sex, data = data, weights = Freq)
DynNom.ols(model, data)
## End(Not run)
if (interactive()) {
data1 <- data.frame(state.x77)
fit1 <- ols(Life.Exp ~ Population + Income + Murder + Frost , data = data1)
DynNom(fit1, data1)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.