Dear AppliedEpi-team,
I am currently using the code offered in the EpiRHandbook for ITS.
While doing so I seem to have found an Error in the skript. I already ran it with two different datasets (including the one from the handbook). I need this analysis pretty soon to evaluate the implementation of a new hepatitis testing strategy in Germany.
The error occurs in this part of the code (or rather the last bit where “observed” is created):
define the model you want to fit (negative binomial)
model <- glm_nb_model(
case_int ~
epiweek +
fourier +
intervention +
time_post
)
fitted_model <- trending::fit(model, counts)
observed <- predict(fitted_model, simulate_pi = FALSE)
While running the skript this error code appears:
> rlang::last_trace()
<error/rlang_error>
Error in `cbind()`:
! Not supported for tsibble.
i Please use `dplyr::bind_cols()` instead.
---
Backtrace:
x
1. +-stats::predict(fitted_model, simulate_pi = FALSE)
2. \-trending:::predict.trending_model_fit(fitted_model, simulate_pi = FALSE)
3. \-object$predict(...)
4. +-trending:::add_confidence_interval(model, newdata, alpha)
5. \-trending:::add_confidence_interval.glm(model, newdata, alpha)
6. \-base::cbind(...)
7. \-tsibble (local) cbind(deparse.level, ...)
8. \-rlang::abort(c("Not supported for tsibble.", i = "Please use `dplyr::bind_cols()` instead."))
I hope you can find a quick solution so I can use the code.
Anyways, thank you so much for the handbook! I used a lot of the skripts for my analysis.
Kind regards
Renke