| fit_population | R Documentation |
SurvStat outputSurvStat can be queried for count or incidence. From the combination of
these metrics queried across the whole range of disease notifications for any
given year we can infer a stratified population size, that SurvStat is using
to calculate it's incidence. This is simply modelled with a local polynomial
over time to allow us to fill in weekly population denominators.
fit_population(count_df, .progress = TRUE)
infer_population(
age_group = NULL,
geography = NULL,
years = NULL,
.progress = TRUE
)
count_df |
a dataframe from the output of |
.progress |
by default a progress bar is shown, which may be important
if many downloads are needed to fulfil the request. It can be disabled
by setting this to |
age_group |
(optional) the age group of interest as a |
geography |
(optional) one of |
years |
(optional) a vector of years to limit the response to. This may
be useful to limit the size of returned pages in the event the |
the count_df dataframe with an additional population column
a dataframe with geography, age grouping, year and population columns
infer_population(): Query SurvStat for data to impute a population denominator
# snapshot:
get_snapshot(
disease = diseases$`COVID-19`,
geography = "state",
season=2024
) %>%
fit_population() %>%
dplyr::glimpse()
# timeseries
# A weekly population estimate is inferred from the yearly data:
get_timeseries(
diseases$`COVID-19`,
measure = "Count",
age_group = age_groups$children_coarse
) %>%
fit_population() %>%
dplyr::glimpse()
infer_population(years=2020:2025) %>% dplyr::glimpse()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.