Brief analysis of Covid 19 cases and deaths in Brazil, data collected on may 7, 2020.

Data available from: https://covid.saude.gov.br/

Loading tidyverse

library(tidyverse)
## -- Attaching packages ---------------------------------------------------------------------------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.0     v purrr   0.3.4
## v tibble  3.0.1     v dplyr   0.8.5
## v tidyr   1.0.2     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.5.0
## -- Conflicts ------------------------------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()

Session Information

sessionInfo()
## R version 4.0.0 (2020-04-24)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 18362)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United Kingdom.1252 
## [2] LC_CTYPE=English_United Kingdom.1252   
## [3] LC_MONETARY=English_United Kingdom.1252
## [4] LC_NUMERIC=C                           
## [5] LC_TIME=English_United Kingdom.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] forcats_0.5.0   stringr_1.4.0   dplyr_0.8.5     purrr_0.3.4    
## [5] readr_1.3.1     tidyr_1.0.2     tibble_3.0.1    ggplot2_3.3.0  
## [9] tidyverse_1.3.0
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_1.0.0 xfun_0.13        haven_2.2.0      lattice_0.20-41 
##  [5] colorspace_1.4-1 vctrs_0.2.4      generics_0.0.2   htmltools_0.4.0 
##  [9] yaml_2.2.1       rlang_0.4.5      pillar_1.4.4     glue_1.4.0      
## [13] withr_2.2.0      DBI_1.1.0        dbplyr_1.4.3     modelr_0.1.7    
## [17] readxl_1.3.1     lifecycle_0.2.0  munsell_0.5.0    gtable_0.3.0    
## [21] cellranger_1.1.0 rvest_0.3.5      evaluate_0.14    knitr_1.28      
## [25] fansi_0.4.1      broom_0.5.6      Rcpp_1.0.4.6     scales_1.1.0    
## [29] backports_1.1.6  jsonlite_1.6.1   fs_1.4.1         hms_0.5.3       
## [33] digest_0.6.25    stringi_1.4.6    grid_4.0.0       cli_2.0.2       
## [37] tools_4.0.0      magrittr_1.5     crayon_1.3.4     pkgconfig_2.0.3 
## [41] ellipsis_0.3.0   xml2_1.3.2       reprex_0.3.0     lubridate_1.7.8 
## [45] assertthat_0.2.1 rmarkdown_2.1    httr_1.4.1       rstudioapi_0.11 
## [49] R6_2.4.1         nlme_3.1-147     compiler_4.0.0

Loading data

df <- read_csv2("arquivo_geral.csv")
## Using ',' as decimal and '.' as grouping mark. Use read_delim() for more control.
## Parsed with column specification:
## cols(
##   regiao = col_character(),
##   estado = col_character(),
##   data = col_date(format = ""),
##   casosNovos = col_double(),
##   casosAcumulados = col_double(),
##   obitosNovos = col_double(),
##   obitosAcumulados = col_double()
## )

Plots

summary(df)
##     regiao             estado               data              casosNovos     
##  Length:2646        Length:2646        Min.   :2020-01-30   Min.   :   0.00  
##  Class :character   Class :character   1st Qu.:2020-02-23   1st Qu.:   0.00  
##  Mode  :character   Mode  :character   Median :2020-03-18   Median :   0.00  
##                                        Mean   :2020-03-18   Mean   :  47.32  
##                                        3rd Qu.:2020-04-12   3rd Qu.:  24.00  
##                                        Max.   :2020-05-06   Max.   :3800.00  
##  casosAcumulados    obitosNovos      obitosAcumulados 
##  Min.   :    0.0   Min.   :  0.000   Min.   :   0.00  
##  1st Qu.:    0.0   1st Qu.:  0.000   1st Qu.:   0.00  
##  Median :    4.0   Median :  0.000   Median :   0.00  
##  Mean   :  646.9   Mean   :  3.226   Mean   :  41.89  
##  3rd Qu.:  274.0   3rd Qu.:  1.000   3rd Qu.:   9.00  
##  Max.   :37853.0   Max.   :224.000   Max.   :3045.00
df %>% ggplot(aes(x = data, y = casosNovos, col = estado)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% ggplot(aes(x = data, y = casosNovos, col = regiao)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% ggplot(aes(x = data, y = obitosNovos, col = estado)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% ggplot(aes(x = data, y = obitosNovos, col = regiao)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% ggplot(aes(x = data, y = obitosAcumulados, col = estado)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% ggplot(aes(x = data, y = obitosAcumulados, col = regiao)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% filter(estado == "SP") %>% ggplot(aes(x = data, y = obitosAcumulados)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

df %>% filter(estado == "SP") %>% ggplot(aes(x = data, y = obitosNovos)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'