train_event_models: Events model trainer

Description Usage Arguments Details Value Examples

View source: R/train_event_models.R

Description

This function trains models that estimate the average daily number of events.

Usage

1
2
3
4
5
6
train_event_models(
  health_events_history = NULL,
  weather_history = NULL,
  ...,
  use_ita = FALSE
)

Arguments

health_events_history

A data frame with historical health events data. At least one week for each month for at least one year (full years are obviusly preferrend) are needed in order to take into account seasonal trends. Colum names must be included in: - mort_all = daily number of death (any causes); - mort_cardiac = daily number of death (cardiac causes only); - mort_resp = daily number of death (respiratory casues only); - mort_cer = daily number of death (cerebrovascular causes only); - hosp_cardiac = daily number of hospitalization (cardiac causes only); - hosp_resp = daily number of hospitalization (respiratory casues only); - hosp_cer = daily number of hospitalization (cerebrovascular causes only);

weather_history

[data frame] A data frame with weather historical data with number of rows equal to the lenght of health_events_history and at least the following column (with exactly the same column names): - date = date expressed in the format 'yyyy-mm-dd'; - temp_mean = mean temperature of corresponding day (Celsius); - press_bar_mean = mean pressure of corresponding day (hPascal); - pm10 = mean value of pm10 of corresponding day (μ g/m^3); - pm25 = mean value of pm25 of corresponding day (μ g/m^3); - no2 = mean value of no2 of corresponding day (μ g/m^3).

If provided, by a column named 038h, also information of O3 daily maximum concentration for the daily 8-hours moving-means will be used (only for summer period, i.e., from April, 1st, to September, 30th).

...

Other possible options passed to the function

use_ita

[lgl] (default = FALSE) use italian historical data on weather if the user cannot provide more specific data.

Details

The output is a list of three lists, named summer, non_summer and full_year. The first two are used if ozone data are provided. They refer to a specific set of models that consider also the ozone in summer period and only other pollutants in the rest of the year. The last set (i.e., list) refers to a model that is used if any knowledge about ozone concentrations is provided.

Value

a list of three sets of gam models, one set with the summer model for each type of event provided in health_events_history (taking into account also information from O3), one set for the non-summer models (using only non-O3 pollutant information) and a set of full-year models which do not use information on O3 (if not provided). Together all the model of the first two sets or the models of the third set are alternative NULL. Output is returned invisible(). See Details section for more informations.

Examples

1
2
3
4
5
6
## Not run: 
  library(imthcm)
  test_models    <- train_event_models(test_health, test_weather)
  default_models <- train_event_models(use_ita = TRUE)

## End(Not run)

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