Skip to contents

Allows summary estimates to be passed as the first argument, so that as_epidist_meta_model(estimates) and as_epidist_meta_model(estimates = estimates) are equivalent.

Usage

# S3 method for class 'epidist_estimates_data'
as_epidist_meta_model(data, estimates = NULL, ...)

Arguments

data

An epidist_estimates_data object.

estimates

An epidist_estimates_data object of published summary estimates, or NULL.

...

Additional arguments passed to methods.

Details

A model built from summaries alone takes no primary argument, because summary rows tilt the primary event by the growth_rate metadata of their study rather than by an estimated parameter. Passing one is an error.

Examples

estimates <- as_epidist_estimates_data(
  data.frame(
    study = c("A", "A"),
    type = c("mean", "sd"),
    value = c(7.5, 3.6),
    n = c(120, 120),
    relative_obs_time = c(20, 20),
    trunc_adjusted = c(FALSE, FALSE),
    cens_adjusted = c(0, 0)
  )
)
#>  No `pwindow` column supplied, assuming a censoring window of 1 (daily
#>   reporting) for every study.
#>  No `swindow` column supplied, assuming a censoring window of 1 (daily
#>   reporting) for every study.
#>  No trunc_design column supplied, assuming every study that did not adjust for
#>   right truncation followed a cohort with a common observation time rather than
#>   accruing primary events up to a calendar collection stop.
#>  No max_delay column supplied, using the delay beyond which 1% of the second
#>   moment of a lognormal matched to each study's summaries lies (at least 10 and
#>   at most twenty times the largest reported value, in whole secondary windows)
#>   as the grid cutoff, or five times the largest reported value where nothing
#>   can be matched. Raise it if the delay has a longer tail than that, and lower
#>   it to speed up fitting.
as_epidist_meta_model(estimates)
#> # A tibble: 1 × 20
#>   delay_lwr     n obs_type study_n trunc_adjusted trunc_design cens_adjusted
#>       <int> <dbl>    <int>   <int>          <int>        <int>         <int>
#> 1         0     1        5     120              0            0             0
#> # ℹ 13 more variables: group_start <int>, group_len <int>, chol_start <int>,
#> #   n_quad <int>, relative_obs_time <dbl>, pwindow <dbl>, swindow <dbl>,
#> #   delay_upr <dbl>, delay_min <dbl>, report_se <dbl>, quantile_p <dbl>,
#> #   growth_rate <dbl>, study <chr>