Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time series changes #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added time/images/example_epicurve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 31 additions & 19 deletions time/time01/time01.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ timeseries <- rio::import("../data/norsyss.xlsx")

---

# Time series

- A set of observations arranged in chronological order
- Performed in many fields, many applications
- We will be focusing on "anomaly detection" (also known as "aberration analysis")
- Used in near real-time surveillance to identify unexpected patterns in data
- Allows for informed decision-making and outbreak detection

---

# Overview

```{r, eval = TRUE, echo = FALSE, out.width = "80%", out.height = "auto"}
Expand Down Expand Up @@ -171,16 +181,6 @@ Please write in the chat:

---

# Time series

- A set of observations arranged in chronological order
- Performed in many fields, many applications
- We will be focusing on "anomaly detection" (also known as "aberration analysis")
- Used in near real-time surveillance to identify unexpected patterns in data
- Allows for informed decision-making and outbreak detection

---

# Words are important

You always have "**recorded** cases" or "**recorded** deaths", not "cases" or "deaths".
Expand Down Expand Up @@ -358,14 +358,14 @@ analysis_trend <- csalert::short_term_trend_sts_v1(

pd$status <- analysis_trend@alarm[,"observed1"]
pd$sunday_of_isoweek <- as.Date(pd$sunday_of_isoweek)
pd_triangles <- pd[pd$status==1,]


pd <- pd %>%
filter(isoyear %in% 2021:2022)

pd_triangles <- pd[pd$status==1,]

q <- ggplot(
pd_triangles,
pd,
aes(
x = as.Date(sunday_of_isoweek),
y = consultations_icpc2group_n
Expand Down Expand Up @@ -399,11 +399,15 @@ q

---

# Exercise time
# Today's structure

The best way to learn is to try it yourself!
- I will now perform a small demo.
- After the demo, you will begin with your exercises.
- There will be a midway presentation of around 10 minutes.
- After the presentation, you will continue with your exercises.
- There will be a wrap-up demo/presentation at the end.

**As you go along, please remember to type into the chat if you have any questions.**
**As you do your exercises, please raise your hand if you need help. Messages in the main chat disappear each time we go into breakout rooms, so the most reliable way to get our attention is by raising your hand.**

---

Expand Down Expand Up @@ -660,18 +664,26 @@ q
Remember that you don't **need** to do the most complicated model.
You can try all three models, and see if they are necessary.


---

# Exercise time

The best way to learn is to try it yourself!

**As you go along, please remember to type into the chat if you have any questions.**
**As you do your exercises, please raise your hand if you need help. Messages in the main chat disappear each time we go into breakout rooms, so the most reliable way to get our attention is by raising your hand.**

---

**You can also raise your hand if you'd like a 1-on-1 chat in a breakout room**
# Wrap up

.pull-right[
```{r, eval = TRUE, echo = FALSE}
# Using here() alone won't work because Rmd folder becomes the rendering root.
# adding xfun::relative_path() creates a dynamic file path between the Rmd location and the here() path. It dynamically creates the ../../etc filepath.

knitr::include_graphics("../images/example_epicurve.png")
```
]



12 changes: 8 additions & 4 deletions time/time02/time02.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ kable(
```

---

# Day-of-week effect

.pull-left[
Expand Down Expand Up @@ -366,11 +367,14 @@ print(d)

---

# Exercise time
# Today's structure

The best way to learn is to try it yourself!
- I will now perform a small demo.
- After the demo, you will begin with your exercises.
- There will **not** be a midway presentation.
- There will be a wrap-up demo/presentation at the end.

**As you go along, please remember to type into the chat if you have any questions.**
**As you do your exercises, please raise your hand if you need help. Messages in the main chat disappear each time we go into breakout rooms, so the most reliable way to get our attention is by raising your hand.**

---

Expand All @@ -397,7 +401,7 @@ Where do you go from here?
# Things to be aware of

- **Redistricting** is not fun, but ignoring it won't make it go away. Be aware!
- Be aware of how **registration delay** is affecting your results!
- Be aware of how **registration/reporting delay** is affecting your results!
- If you're working in an international team, be aware of MM-DD-YYYY versus DD-MM-YYYY confusion.

---
Expand Down