View source: R/fct_metamodel.R
plot_tornado | R Documentation |
This function plots the results of the deterministic sensitivity analyses (DSA) in a Tornado diagram. (STILL IN DEVELOPMENT)
plot_tornado(df, df_basecase, outcome)
df |
a dataframe. This dataframe should contain the results of the function |
df_basecase |
a dataframe. This object should contain the original probabilistic analysis inputs and outputs, and the variable defined in 'outcome'. |
outcome |
character. Name of the output variable of the DSA. |
The code to draw the Tornado diagram was obtained from https://stackoverflow.com/questions/55751978/tornado-both-sided-horizontal-bar-plot-in-r-with-chart-axes-crosses-at-a-givenStakoverflow. The 'df' object should contain the following variables; "Parameters" (the parameters to include in the Tornado diagram), "Lower_Bound" (the model outcomes when using the lower bound of the parameter value), "Upper_Bound" (the model outcomes when using the upper bound of the parameter value).
A ggplot graph.
# Fitting meta model with two variables using the summary data
data(df_pa)
lm_res_2 <- fit_lm_metamodel(df = df_pa,
y = "Inc_QALY",
x = c("p_pfsd", "p_pdd")
)
# Estimating DSA inputs
df_res_dsa <- dsa_lm_metamodel(df = df_pa,
lm_metamodel = lm_res_2)
# Plotting Tornado diagram
plot_tornado(df = df_res_dsa,
df_basecase = df_pa,
outcome = "Inc_QALY")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.