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

Suggested cleaning of README, INDEX and vignettes #29

Merged
merged 1 commit into from
Jul 27, 2022
Merged
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
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ library(nowcaster)

## First example on LazyData

When the package is loaded it disponibilize a LazyData file, `sariBH`, it is a annonymized records of Severe Acute Respiratory Illness notified in the city of Belo Horizonte, since March 2020 to April 2022. To load it basically write:
When the package is loaded it provides a LazyData file, `sariBH`, it is a anonymized records of Severe Acute Respiratory Illness notified in the city of Belo Horizonte, since March 2020 to April 2022. To load it basically write:

```{r data-bh}
# Loading Belo Horizonte SARI dataset
Expand Down Expand Up @@ -113,7 +113,7 @@ nowcasting_bh_no_age$total |>
labs(x = '', y = 'Nº Cases')
```

This is an example were the estimate was done without considering any type of strucuture in data, which is the first assumption for the nowcasting.
This is an example were the estimate was done without considering any type of structure in data, which is the first assumption for the nowcasting.

## Nowcasting as a tool to support decision making

Expand Down Expand Up @@ -145,7 +145,7 @@ data_by_week |>
scale_x_date(date_breaks = '2 weeks', date_labels = '%V/%y', name = 'Date in Weeks')
```

On this filtered data, we estimate the cases already that started its date of onset of symptons but were not yet reported, so there not in the database. We just pass to the `nowcasting_inla` function, the dataset filtered, flag for the columns where are the `date_onset` and `date_report`, we add the flag for the function return back the epidemic curve by epiweek.
On this filtered data, we estimate the cases already that started its date of onset of symptoms but were not yet reported, so there not in the database. We just pass to the `nowcasting_inla` function, the dataset filtered, flag for the columns where are the `date_onset` and `date_report`, we add the flag for the function return back the epidemic curve by epiweek.

```{r now_no_age_data}
nowcasting_bh_no_age <- nowcasting_inla(dataset = srag_now,
Expand Down Expand Up @@ -193,7 +193,7 @@ nowcasting_bh_no_age$total |>

```

And as expected, the nowcasting estimated a rising on curve when it were observed a decaying. Adding to the plot what actually has happened in that period, with the data inserted posterioly the period for when the nowcasting estimated the rising in the curve for SARI hospitalizations.
And as expected, the nowcasting estimated a rising on curve when it were observed a decaying. Adding to the plot what actually has happened in that period, with the data inserted posteriorly the period for when the nowcasting estimated the rising in the curve for SARI hospitalizations.

```{r}
nowcasting_bh_no_age$total %>%
Expand All @@ -217,7 +217,7 @@ nowcasting_bh_no_age$total %>%
scale_x_date(date_breaks = '2 weeks', date_labels = '%V/%y', name = 'Date in Weeks')+
labs(x = '', y = 'Nº Cases')
```
This end the first simple example when estimating the already started events but not yet reported (i.e. nowcasting). The relevance of nowcasting for public health decision is given by the understading that what is present on the databases are only a picture of the real time situation. The above graph can help policy makers on what decisions takes in the face of a rising curve of hospitalisations.
This end the first simple example when estimating the already started events but not yet reported (i.e. nowcasting). The relevance of nowcasting for public health decision is given by the understanding that what is present on the databases are only a picture of the real time situation. The above graph can help policy makers on what decisions takes in the face of a rising curve of hospitalisations.

## Structured data, Age

Expand All @@ -239,7 +239,7 @@ nowcasting_bh_age <- nowcasting_inla(dataset = sragBH,
age_col = Idade)
```

Each of the estimates returned by `nowcasting_inla` has the same form as in the non-structured case. On the nowcasting estimates, it returns a data.frame with the posterior edian and 50% and 95% credible intervals, (LIb and LSb) and (LI and LS) respectively.
Each of the estimates returned by `nowcasting_inla` has the same form as in the non-structured case. On the nowcasting estimates, it returns a data.frame with the posterior median and 50% and 95% credible intervals, (LIb and LSb) and (LI and LS) respectively.

```{r plot}
library(ggplot2)
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ surveillance database (SIVEP-Gripe).
## Installing

Before installing the package certify you have an active installation of `INLA`,
to do so you can run the follwing code:
to do so you can run the following code:

``` r
install.packages("INLA",
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/forecasting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ nowcasting_estimate |>

## Uncertainty growth

As we try to forecasting longer ahead of the present date, the uncertaintiy has to grow. This is saw by the opening of the confidence intervals on the last graph. Although it is wide the realized curve still falls inside it, indicating that is assertative on the tendencey of the curve at least. This can be taken to support decision making when planning ahead of the present date. To any other forecasting horizon futher than 1 week ahead, the confidence interval will be wider than this, to help a little we can try a forecasting with an imposed structured on the data. Now, we forecasting parsing the columns for age to the nowcasting function, this can reduce the openning of the confidence interval.
As we try to forecasting longer ahead of the present date, the uncertainty has to grow. This is saw by the opening of the confidence intervals on the last graph. Although it is wide the realized curve still falls inside it, indicating that is assertative on the tendency of the curve at least. This can be taken to support decision making when planning ahead of the present date. To any other forecasting horizon further than 1 week ahead, the confidence interval will be wider than this, to help a little we can try a forecasting with an imposed structured on the data. Now, we forecasting parsing the columns for age to the nowcasting function, this can reduce the opening of the confidence interval.

```{r}
nowcasting_bh_age <- nowcasting_inla(dataset = srag_now,
Expand Down
10 changes: 5 additions & 5 deletions vignettes/articles/nowcasting_importance.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ knitr::opts_chunk$set(

## Nowcasting as a tool to support decision making

Nowcasting a rising curve or a curve on any other moment can give quantitative support for decision making, during the public health crises, the most needed is a way to anticipate, at least, what it is happening at the moment. Nowcasting is the tool for this type of questioning and can gives insights on the data to support nedded decisions.
Nowcasting a rising curve or a curve on any other moment can give quantitative support for decision making, during the public health crises, the most needed is a way to anticipate, at least, what it is happening at the moment. Nowcasting is the tool for this type of questioning and can gives insights on the data to support needed decisions.

We start this section by cutting the original data at a moment of apparent decaying of the SARI hospitalisation, for the city of Belo Horizonte, which had a prompt starting response to the Covid=19 pandemic. The pressure on the health system took more time than the rest of the country, and the data at same time were showing a decay. We filter all cases entered until 4th of July of 2020 by the date of digitasation, a date that the cases shows up in the database.
We start this section by cutting the original data at a moment of apparent decaying of the SARI hospitalisation, for the city of Belo Horizonte, which had a prompt starting response to the Covid=19 pandemic. The pressure on the health system took more time than the rest of the country, and the data at same time were showing a decay. We filter all cases entered until 4th of July of 2020 by the date of digitisation, a date that the cases shows up in the database.

```{r no_age_data}
library(tidyverse)
Expand Down Expand Up @@ -54,7 +54,7 @@ data_by_week |>
name = 'Date in Weeks')
```

On this filtered data, we estimate the cases already that started its date of onset of symptons but were not yet reported, so there not in the database. We just pass to the `nowcasting_inla` function, the dataset filtered, flag for the columns where are the `date_onset` and `date_report`, we add the flag for the function return back the epidemic curve by epiweek.
On this filtered data, we estimate the cases already that started its date of onset of symptoms but were not yet reported, so there not in the database. We just pass to the `nowcasting_inla` function, the dataset filtered, flag for the columns where are the `date_onset` and `date_report`, we add the flag for the function return back the epidemic curve by epiweek.

```{r now_no_age_data}
nowcasting_bh_no_age <- nowcasting_inla(dataset = srag_now,
Expand Down Expand Up @@ -112,7 +112,7 @@ nowcasting_bh_no_age$total |>

```

And as expected, the nowcasting estimated a rising on curve when it were observed a decaying. Adding to the plot what actually has happened in that period, with the data inserted posterioly the period for when the nowcasting estimated the rising in the curve for SARI hospitalizations.
And as expected, the nowcasting estimated a rising on curve when it were observed a decaying. Adding to the plot what actually has happened in that period, with the data inserted posteriorly the period for when the nowcasting estimated the rising in the curve for SARI hospitalizations.

```{r after_one_year}
nowcasting_bh_no_age$total %>%
Expand Down Expand Up @@ -144,4 +144,4 @@ nowcasting_bh_no_age$total %>%
y = 'Nº Cases')
```

This end the first simple example when estimating the already started events but not yet reported (i.e. nowcasting). The relevance of nowcasting for public health decision is given by the understading that what is present on the databases are only a picture of the real time situation. The above graph can help policy makers on what decisions takes in the face of a rising curve of hospitalisations.
This end the first simple example when estimating the already started events but not yet reported (i.e. nowcasting). The relevance of nowcasting for public health decision is given by the understanding that what is present on the databases are only a picture of the real time situation. The above graph can help policy makers on what decisions takes in the face of a rising curve of hospitalisations.
4 changes: 2 additions & 2 deletions vignettes/nowcaster.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ knitr::opts_chunk$set(

## First example on LazyData

When the package is loaded it disponibilize a LazyData file, `sariBH`, it is a annonymized records of Severe Acute Respiratory Illness notified in the city of Belo Horizonte, since March 2020 to April 2022. To load it basically write:
When the package is loaded it provides a LazyData file, `sariBH`, it is a anonymized records of Severe Acute Respiratory Illness notified in the city of Belo Horizonte, since March 2020 to April 2022. To load it basically write:

```{r data-bh}
library(nowcaster)
Expand Down Expand Up @@ -105,4 +105,4 @@ nowcasting_bh_no_age$total |>
y = 'Nº Cases')
```

This is an example were the estimate was done without considering any type of strucuture in data, which is the first assumption for the nowcasting.
This is an example were the estimate was done without considering any type of structure in data, which is the first assumption for the nowcasting.