Description Usage Arguments Value Author(s) See Also Examples
DynNom.cph
displays the results of a cph
model object from rms
package as a dynamic nomogram in an 'RStudio' panel or web browser.
1 2 | DynNom.cph(model, data, clevel = 0.95, m.summary = c("raw", "formatted"),
covariate = c("slider", "numeric"), ptype = c("st", "1-st"))
|
model |
a |
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. |
ptype |
If "st" (the default) is chosen, a plot of the estimated survivor function, S(t), is displayed. If "1-st" is chosen a plot of 1- S(t) is 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 graphically as either the Kaplan-Meier in the Estimated S(t)
tab or the Predicted Survival
tab. Table of individual predictions and model output are available in the Numerical Summary
and Model Summary
tabs, respectively.
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 26 27 | ## Not run:
# example 1
data = veteran
model1 <- cph((Surv(log(time), status)) ~ rcs(age, 4) * strat(trt) +
diagtime * strat(prior) + lsp(karno, 60), data = veteran)
model1 <- update(model1, x = T, y = T, surv = T)
DynNom.cph(model1, data)
DynNom(model1, data, ptype = "1-st")
# example 2
data(lung)
sfit = Surv(lung$time, lung$status)
model2 <- cph(sfit ~ age + strat(sex) + ph.ecog , data = lung)
DynNom.cph(model2, lung)
## End(Not run)
if (interactive()) {
data.ovary <- ovarian
data.ovary$resid.ds <- as.factor(data.ovary$resid.ds)
levels(data.ovary$resid.ds) <- c("no", "yes")
data.ovary$rx <- as.factor(data.ovary$rx)
data.ovary$ecog.ps <- as.factor(data.ovary$ecog.ps)
model3 <- cph(Surv(futime, fustat) ~ age + resid.ds * rx + ecog.ps, data = data.ovary)
DynNom(model3, data.ovary)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.