
The latent model method for epidist_aggregate_data objects
Source: R/latent_model.R
as_epidist_latent_model.epidist_aggregate_data.RdThis method converts aggregate data to a latent model format by first
converting it to linelist format using
as_epidist_linelist_data.epidist_aggregate_data() and then passing it to
as_epidist_latent_model.epidist_linelist_data(). This ensures that the
counts in the aggregate data are properly expanded into individual
observations before fitting the latent model.
Usage
# S3 method for class 'epidist_aggregate_data'
as_epidist_latent_model(data, primary = .primary_choices(), ...)Arguments
- data
An
epidist_aggregate_dataobject- primary
The distribution of the primary event within its censoring window.
"uniform", the default, assumes it is equally likely at any point."expgrowth"tilts it, with the growth rate estimated as thepgrowthdistributional parameter.- ...
Not used in this method.
See also
Other latent_model:
as_epidist_latent_model(),
as_epidist_latent_model.epidist_linelist_data(),
epidist_family_model.epidist_latent_model(),
epidist_formula_model.epidist_latent_model(),
epidist_model_prior.epidist_latent_model(),
epidist_newdata.epidist_latent_model(),
is_epidist_latent_model(),
new_epidist_latent_model()
Examples
sierra_leone_ebola_data |>
dplyr::count(date_of_symptom_onset, date_of_sample_tested) |>
as_epidist_aggregate_data(
pdate_lwr = "date_of_symptom_onset",
sdate_lwr = "date_of_sample_tested",
n = "n"
) |>
as_epidist_latent_model()
#> ℹ No primary event upper bound provided, using the primary event lower bound + 1 day as the assumed upper bound.
#> ℹ No secondary event upper bound provided, using the secondary event lower bound + 1 day as the assumed upper bound.
#> ℹ No observation time column provided, using 2015-09-14 as the observation date (the maximum of the secondary event upper bound).
#> # A tibble: 8,358 × 16
#> ptime_lwr ptime_upr stime_lwr stime_upr obs_time pdate_lwr sdate_lwr
#> <dbl> <dbl> <dbl> <dbl> <dbl> <date> <date>
#> 1 0 1 5 6 484 2014-05-18 2014-05-23
#> 2 2 3 7 8 484 2014-05-20 2014-05-25
#> 3 2 3 7 8 484 2014-05-20 2014-05-25
#> 4 3 4 8 9 484 2014-05-21 2014-05-26
#> 5 3 4 8 9 484 2014-05-21 2014-05-26
#> 6 3 4 8 9 484 2014-05-21 2014-05-26
#> 7 3 4 8 9 484 2014-05-21 2014-05-26
#> 8 4 5 9 10 484 2014-05-22 2014-05-27
#> 9 4 5 9 10 484 2014-05-22 2014-05-27
#> 10 4 5 9 10 484 2014-05-22 2014-05-27
#> # ℹ 8,348 more rows
#> # ℹ 9 more variables: pdate_upr <date>, sdate_upr <date>, obs_date <date>,
#> # relative_obs_time <dbl>, pwindow <dbl>, woverlap <dbl>, swindow <dbl>,
#> # delay <dbl>, .row_id <int>