fit_models: Fit all the models and return a list object suitable for...

Description Usage Arguments Details Value

View source: R/fit_models.R

Description

Fit all the models and return a list object suitable for DFMIP.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fit_models(
  x,
  path_2_case_data = here::here("data-raw/wnv_by_county.csv"),
  case_type = c("neuro", "all"),
  match_variable = "fips",
  case_variable = "cases",
  measure = NULL,
  nUnits = NULL,
  startUnit = NULL,
  unit = NULL,
  models = NULL
)

Arguments

x

tibble or data frame that defines the desired prediction targets. Must have at least a FIPS code and year.

path_2_case_data

character file path to the case data

case_type

character type of case data

match_variable

character name of the field to match data on

case_variable

character name of the case field in the case data

measure

character vector of variables to use for lagging

nUnits

integer number of units to lag backwards

startUnit

integer unit to start lagging from

unit

character name of the variable identifying the lag units

models

list of formulas for to use. No checks are performed to ensure the formulas are consistent with other arguments.

Details

This function uses the rows in x to define the prediction targets for the models. There must be at least two fields, the 5 digit fips code to identify the county as a character variable and a year numeric variable to identify the year.

The WNV case data cannot be posted publicly as a part of this package. This package assumes the case data are available in a subdirectory of the working directory called data-raw, in a file called wnv_by_county.csv which has rows identified by the same fips codes and a year variable. Case counts are assumed to be in a variable called "cases". There must be at least one row for each fips code in x.

Value

a list of containing predicted cases for the target in the format expected by DFMIP


atyre2/unlwnv documentation built on Oct. 25, 2020, 10:18 a.m.