sim_baseline: Expected baseline health outcomes

Description Usage Arguments Value Examples

View source: R/sim_exposure.R

Description

Generates expected baseline health outcome counts based on average outcome and desired seasonal and / or long-term trends.

Usage

1
2
sim_baseline(n, lambda, trend = "no trend", slope = 1, amp = 0.6,
  start.date = "2000-01-01")

Arguments

n

A numeric value specifying the number of days for which to simulate data

lambda

A numeric value specifying the mean for the expected outcomes

trend

A character string that specifies the desired trend function. Options are:

  • "no trend": No trend, either seasonal or long-term (default).

  • "cos1": A seasonal trend only.

  • "cos2": A seasonal trend with variable amplitude across years.

  • "cos3": A seasonal trend with steadily decreasing amplitude over time.

  • "linear": A linear long-term trend with no seasonal trend.

  • "curvilinear": A curved long-term trend with no seasonal trend.

  • "cos1linear": A seasonal trend plus a linear long-term trend.

See the package vignette for examples of the shapes of these trends.

slope

A numeric value specifying the slope of the trend, to be used with trend = "linear" or trend = "cos1linear".

amp

A numeric value specifying the amplitude of the seasonal trend. Must be between -1 and 1.

start.date

A date in the format "yyyy-mm-dd" specifying the first day for which to simulate data

Value

A data frame with the date and expected baseline outcome count for each day of simulated data.

Examples

1
sim_baseline(n = 5, lambda = 100, trend = "cos1")

eesim documentation built on June 4, 2017, 1:03 a.m.