create_baseline: Create a series of baseline outcomes

Description Usage Arguments Value Examples

View source: R/customizable_functions.R

Description

Creates a time series of baseline outcome values. This function allows the user to input a custom function if desired to specify outcome trend.

Usage

1
2
create_baseline(n, average_baseline = NULL, trend = "no trend", slope = 1,
  amp = 0.6, cust_base_func = NULL, ...)

Arguments

n

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

average_baseline

A non-negative numeric value specifying the average outcome value over all simulated days.

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.

cust_base_func

A R object name specifying a user-made custom function for baseline trend.

...

Optional arguments to a custom baseline function

Value

A numeric vector of baseline outcome values

Examples

1
create_baseline(n = 5, average_baseline = 22, trend = "linear")

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