Skip to content

Commit

Permalink
add peak estimation section
Browse files Browse the repository at this point in the history
  • Loading branch information
Degoot-AM committed Jun 20, 2024
1 parent 25c2116 commit 89b2991
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions episodes/describe-cases.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ base::plot(cum_df) +

Note that this function preserve grouping, i.e., if the the `incidence2` object contains groups, then it will accumlate the cases accrodingly.

## Peak estimation

One can estimate the peak --the time with highest number of recorded cases-- using `estimate_peak()` function from the {incidence2} package.
This function employs a bootstrapping method to determine the peak time.

```{r, message=FALSE, warning=FALSE}
peak <- incidence2::estimate_peak(
dialy_incidence_data,
n = 100,
alpha = 0.05,
first_only = TRUE,
progress = FALSE
)
print(peak)
```
This example demonstrates how to estimate the peak time using the `estimate_peak()` function at $95%$
confidence interval and using 100 bootstrap samples.



::::::::::::::::::::::::::::::::::::: challenge

## Challenge 1: Can you do it?
Expand Down

0 comments on commit 89b2991

Please sign in to comment.