custom_baseline {eesim}R Documentation

Pull smoothed Chicago NMMAPS health outcome data

Description

Example of a custom baseline function that can be passed to eesim or power_calc. By default, this function pulls smoothed data from the chicagoNMMAPS data set in the dlnm package. The user may also input a different data set from which to pull data. The function uses a smoothed function of this observed data as the underlying baseline outcome trend in simulating data.

Usage

custom_baseline(n, df = dlnm::chicagoNMMAPS, outcome_type = "cvd",
  start.date = "2000-01-01")

Arguments

n

A numeric value specifying the number of days for which to obtain an exposure value.

df

Data frame from which to pull exposure values.

outcome_type

A character string specifying the desired health outcome metric. Options are:

  • "death"

  • "cvd"

  • "resp"

(Note: These are the column names for outcome counts in the observed data.)

start.date

A date of the format "yyyy-mm-dd" from which to begin pulling exposure values. Dates in the Chicago NMMAPS data set are from 1987-01-01 to 2000-12-31.

Value

A data frame with one column for date and one column for baseline outcome values.

Examples

custom_baseline(n = 5)
custom_baseline(n = 5, outcome_type = "death")


[Package eesim version 0.1.0 Index]