Skip to contents

The naive model accounts for neither censoring nor truncation, so the only variable it uses beyond those in the model formula is the response. This method adds it, set to NA because it is the quantity being predicted.

Usage

# S3 method for class 'epidist_naive_model'
epidist_newdata(data, ...)

Arguments

data

An epidist data object, such as one returned by as_epidist_marginal_model(), as_epidist_latent_model() or as_epidist_naive_model().

...

Variables to expand into a grid, passed to tidyr::expand(). Supply the variables used in the model formula, such as sex. Each combination of their unique values becomes a row. Supply no variables to get a single row, which is what an intercept only model needs. A variable expanded here keeps its expanded values, so naming it as an argument of the method as well is an error.

Value

A tibble::tibble() of newdata ready to predict from.

Examples

prep_obs <- sierra_leone_ebola_data |>
  as_epidist_linelist_data(
    pdate_lwr = "date_of_symptom_onset",
    sdate_lwr = "date_of_sample_tested"
  ) |>
  as_epidist_naive_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 row for each sex
epidist_newdata(prep_obs, sex)
#> # A tibble: 3 × 2
#>   sex    delay
#>   <chr>  <dbl>
#> 1 Female    NA
#> 2 Male      NA
#> 3 NA        NA