A tornado plot is a visualization of the range of outputs expected from a variety of inputs, or alternatively, the sensitivity of the output to the range of inputs. The center of the tornado is plotted at the response expected from the mean of each input variable. For a given variable, the width of the tornado is determined by the range of the variable, a multiplicative factor of the variable, or a quantile of the variable. Variables are ordered vertically with the widest bar at the top and narrowest at the bottom. Only one variable is moved from its mean value at a time. Factors or categorical variables have also been added to these plots by plotting dots at the resulting output as each factor is varied through all of its levels. The base factor level is chosen as the input variable for the center of the tornado.
# S3 method for coxph
tornado(model, type = "PercentChange", alpha = 0.1, dict = NA, modeldata, ...)
a tornado_plot
object
the type of tornado plot
the data required for the plot
the model family if available
a model object
PercentChange
, percentiles
, ranges
, or StdDev
the level of change, the percentile level, or the number of standard deviations
a dictionary to translate variables for the plot. The dictionary
must be a list or data.frame with elements old
and new
. The
old
element must contain each variable in the model.
the data used to fit the model
further arguments, not used
gtest <- survival::coxph(survival::Surv(stop, event) ~ rx + size + number,
survival::bladder)
torn <- tornado(gtest, modeldata = survival::bladder, type = "PercentChange",
alpha = 0.10)
plot(torn, xlabel = "Risk")
Run the code above in your browser using DataLab