Description Usage Arguments Value See Also Examples
View source: R/sample_annual_decrease_nots.R
This function samples the percentage annual decrease, using TB notifications.
The percentage annual change is first estimated using prop.test
, along with the 95
intervals. Assuming that the percentage annual decrease is normally distributed multiple samples are then
taken. This is returned as a tibble, containing the nested dataframe and a nested matrix ready to be
used by sutherland_model
.
1 2 3 | sample_annual_decrease_nots(notifications = NULL,
TB_cohorts = c("15-19 years", "20-24 years", "25-29 years"),
samples = 100, max_year = NULL, years_to_avg = 3)
|
notifications |
A dataframe of notifications, it must contain a year variable, and the second variable
must be the number of notifications. If not specified defaults to |
TB_cohorts |
A character vector indicating the names of the cohorts modelled. Defaults to 15-19 years, 20-24 years, and 25-29 years. |
samples |
Numeric, the number of samples to take. Defaults to 100. |
max_year |
Numeric, set as greater than the maximum year in the dataframe if interested in projection.
Defaults to |
years_to_avg |
Numeric, the number of years over which to average the percentage decrease when estimating the ongoing percentage decrease. |
A nested tibble, containing the sample number, and both a nested dataframe and nested matrix of annual percentage changes.
sample_per_decrease
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.