plot_economics_fit.Rd
This function generates and saves plots comparing fitted distributions to reference data for risks, QALYs, and costs across different age groups.
plot_economics_fit(object)
None. The function saves the generated plots to the specified directory.
The function performs the following steps:
Checks if the directory for saving plots exists, and creates it if it doesn't.
Extracts unique age groups from the economic data.
Defines a helper function to extract mean and 95% uncertainty intervals for model outcomes.
Extracts fitted model outcomes for risks, QALYs, and costs.
Prepares data frames for risks, QALYs, and costs by merging reference data with fitted model outcomes.
Defines a helper function to convert data frames to long format for plotting.
Converts the prepared data frames to long format.
Generates and saves plots comparing fitted model outcomes to reference data for risks, QALYs, and costs.
if (FALSE) { # \dontrun{
plot_economics_fit(my_economic_model)
} # }