compute_cost: Compute costs of related health events

Description Usage Arguments Details Value Examples

View source: R/compute_cost.R

Description

This function computes the costs associated the cardiac and respiratory hospitalizations. Individual available costs were associated to stroke occurrence and Congenital Hearth Diseases (CHD) for cardiac events, whereas they were associated to Chronic obstructive pulmonary disease (COPD).

Usage

1
compute_cost(health_events, costs = NULL, ..., use_meps = is.null(costs))

Arguments

health_events

A data frame with predicted health events and relative 95 - 'date' = date of the simulated day; - 'event' = type of event (e.g. mortality for all causes, hospitalizations for cardiac events, ...); - 'lower' = lower bound of 95 of considered health event; - 'fit' = average daily number of considered health event; - 'upper' = upper bound of 95 of considered health event.

costs

A data frame with the related individual costs for events in 'health_events'. Column names must be: - 'event' = events name as they appear in 'health_event'; - 'individual_cost' = individual costs for the related events; - 'currences' = currences in which each cost is expressed.

...

Other possible options passed to the function

use_meps

[lgl] (default = FALSE) use Medical Expenditure Panel Survey (MEPS) of the U.S. Agency for Healthcare Research and Quality costs data on weather if the user cannot provide more specific data.

Details

The output of the function is a data frame. The data frame is composed by simulated days: n rows and 6 columns. Each row gives the fitted number, with relative 95 relavite costs. Each column represents respectively the date of the simulated day, the health outcomes, the 95 predicted average daily number of events, the predicted average daily number of events and the the 95 daily number of events, the 95 particular health events, the average daily costs associated to a particular health event and the 95 to a particular health events.

Value

a data frame with 'n_days' * 'n' rows (where 'n_days' is the number of simulated days, and 'n' is the number of events for which a cost was provided), and 7 columns: - 'date' for which the record is referred, - 'event' the event considered - 'currences' the currences used for the cost - 'lower_individual_cost' the 95 cost - 'fit_individual_cost' the median cost - 'upper_individual_cost' the 95 cost

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
library(imthcm)
default_models <- train_event_models(use_ita = TRUE)

hh_non_summer <- predict_hm(models = default_models,
  weather_history = test_weather,
  weather_today   = test_weather[731L, ]
)

hh_full_year <- predict_hm(models = default_models,
  weather_history = test_weather,
  weather_today   = test_weather[c(731L, 730L), ],
  full_year = TRUE
)

compute_cost(hh_non_summer, use_meps = TRUE)
compute_cost(hh_non_summer, costs = meps_costs)

compute_cost(hh_full_year, use_meps = TRUE)
compute_cost(hh_full_year, costs = meps_costs)

## End(Not run)

UBESP-DCTV/imthcm documentation built on Dec. 2, 2019, 9:26 a.m.