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
epidistdata object, such as one returned byas_epidist_marginal_model(),as_epidist_latent_model()oras_epidist_naive_model().- ...
Variables to expand into a grid, passed to
tidyr::expand(). Supply the variables used in the model formula, such assex. 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.
See also
Other naive_model:
as_epidist_naive_model(),
as_epidist_naive_model.epidist_aggregate_data(),
as_epidist_naive_model.epidist_linelist_data(),
epidist_formula_model.epidist_naive_model(),
epidist_transform_data_model.epidist_naive_model(),
is_epidist_naive_model(),
new_epidist_naive_model()
Other newdata:
epidist_newdata(),
epidist_newdata.default(),
epidist_newdata.epidist_latent_model(),
epidist_newdata.epidist_marginal_model()
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
