Generates expected baseline health outcome counts based on average outcome and desired seasonal and / or long-term trends.
sim_baseline(n, lambda, trend = "no trend", slope = 1, amp = 0.6,
start.date = "2000-01-01")A numeric value specifying the number of days for which to simulate data
A numeric value specifying the mean for the expected outcomes
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.
A numeric value specifying the slope of the trend, to be used
with trend = "linear" or trend = "cos1linear".
A numeric value specifying the amplitude of the seasonal trend. Must be between -1 and 1.
A date in the format "yyyy-mm-dd" specifying the first day for which to simulate data
A data frame with the date and expected baseline outcome count for each day of simulated data.
sim_baseline(n = 5, lambda = 100, trend = "cos1")
Run the code above in your browser using DataLab