plot_tornado: Plot results of DSA in a Tornado diagram

View source: R/fct_metamodel.R

plot_tornadoR Documentation

Plot results of DSA in a Tornado diagram

Description

This function plots the results of the deterministic sensitivity analyses (DSA) in a Tornado diagram. (STILL IN DEVELOPMENT)

Usage

plot_tornado(df, df_basecase, outcome)

Arguments

df

a dataframe. This dataframe should contain the results of the function dsa_lm_metamodel.

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.

Details

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).

Value

A ggplot graph.

Examples

# 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")

Xa4P/pacheck documentation built on April 14, 2025, 1:51 p.m.