Description Usage Arguments Value Examples
View source: R/customizable_functions.R
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.
1 2 | custom_baseline(n, df = dlnm::chicagoNMMAPS, outcome_type = "cvd",
start.date = "2000-01-01")
|
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:
(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. |
A data frame with one column for date and one column for baseline outcome values.
1 2 | custom_baseline(n = 5)
custom_baseline(n = 5, outcome_type = "death")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.