Site permanente para atualização dos dados para o Brasil

A primeira questão é que o número de casos em valor absoluto, pouco ou nada se refere ao verdadeiro poder destrutivo do contágio em cada país. Afinal, o número da população importa para termos uma ideia da importância relativa de cada pessoa para aquele país, e sua probabilidade de contágio.

Apenas em termos ilustrativos, os dois mapas abaixo representam em termos absolutos e termos relativos o imapcto da COVID19

Evolução da COVID19 pelo mundo

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.
## Loading required package: sp
## ### Welcome to rworldmap ###
## For a short introduction type :   vignette('rworldmap')
## 123 codes from your data successfully matched countries in the map
## 48 codes from your data failed to match with a country code in the map
## 120 codes from the map weren't represented in your data

Agora em termos relativos

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.
## 123 codes from your data successfully matched countries in the map
## 48 codes from your data failed to match with a country code in the map
## 120 codes from the map weren't represented in your data

A taxa de crescimento deve obedecer o mesmo padrão do exercício anterior. Qual o percentual da população que está de fato afetada por este virus.

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.

Questões Epidemiológicas

Graficamente em valores absolutos

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.
## [1] "Total de Infectados" "335955"

Graficamente teremos em valores relativos

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.
## [1] "Total de Infectados" "335955"

##  [1] "Iceland"       "Andorra"       "Luxembourg"    "Italy"        
##  [5] "Liechtenstein" "Switzerland"   "Spain"         "Monaco"       
##  [9] "Norway"        "Austria"

Epidemiologicamente

Os modelos epidemilógicos mais simples assumem 4 equações para casos . Tem-se a seguinte configuração de eq. diferencial.

\[\begin{aligned} \frac{dS}{dt} & = -\frac{\beta IS}{N}\\ \\ \frac{dE}{dt} & = \frac{\beta IS}{N} - \kappa E\\ \\ \frac{dI}{dt} & = \kappa E - \gamma I\\ \\ \frac{dR}{dt} & = \gamma I \end{aligned}\]

Colocando no modelo

Resultados

Para os países com o pior nível.

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.

Para o Brasil temos a seguinte configuração

## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.

Para o Ceará temos a seguinte configuração

library(readxl)
ceara <- read_excel("COVID-19_CEARA.xlsx")

SIR <- function(time, state, parameters) {
  par <- as.list(c(state, parameters))
  with(par, {
    dS <- -beta/N * I * S
    dI <- beta/N * I * S - gamma * I
    dR <- gamma * I
    list(c(dS, dI, dR))
  })
}
  
Infected <- as.numeric(ceara$Confirmados)

Day <- 1:(length(Infected))
N <- ceara$Pop
 
old <- par(mfrow = c(1, 2))
plot(Day, Infected, type ="b")
plot(Day, Infected, log = "y")
## Warning in xy.coords(x, y, xlabel, ylabel, log): 11 y values <= 0 omitted
## from logarithmic plot
abline(lm(log10(Infected+exp(1)) ~ Day))
title(paste("Casos Confirmados no Ceará"), outer = TRUE, line = -2)

Analisando o comportamento desde o primeiro contágio

library(wbstats)
library(lubridate)
pop<- wb(country = "all", indicator = "SP.POP.TOTL", mrv = 1)
library(htmlTable)
jhu_url<- paste("https://raw.githubusercontent.com/CSSEGISandData/", 
  "COVID-19/master/csse_covid_19_data/", "csse_covid_19_time_series/", 
  "time_series_19-covid-Confirmed.csv", sep = "")
dados<-read_csv(jhu_url)
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   `Province/State` = col_character(),
##   `Country/Region` = col_character()
## )
## See spec(...) for full column specifications.
paises<-factor(dados$`Country/Region`)
paises<-levels(paises)
dados2<-NULL
library(xts)
for (i in paises){
  c<-subset(dados,dados$`Country/Region`==i)
  c1<-t(c)
     if (dim(c)[1]<2) { 
  c1<-as.xts(x=as.numeric(c1[5:length(c),]),order.by= mdy(colnames(c))[5:length(c)])
   } else {
     c1<-c1[5:length(c),]
     c1<-as.data.frame(apply(c1, 2, as.numeric)) 
     dim(c1)
     c1<-as.xts(x=apply(c1, 1, sum),order.by= mdy(colnames(c))[5:length(c)])
   }
    colnames(c1)<-i
    dados2<-cbind(dados2,c1)
 
}
## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.

## Warning: 4 failed to parse.
nomes<-names(sort(-apply(tail(dados2,1),2,sum)))[1:10]

library("xts")

paises2<-colnames(dados2)
infec<-NULL
for (i in paises2){
  infec<-cbind(infec,as.numeric(subset(dados2,select=i)))
  
}
which(paises2=="Brazil")
## [1] 22
dados2<-as.data.frame(dados2)


plot(1:length(dados2[dados2[,1]>0,1]),dados2[dados2[,1]>0,1], type="l", xlim=c(0,60), ylim=c(0,80000), ylab=NA,xlab=NA)
for( i in 2:171){
points(1:length(dados2[dados2[,i]>0,1]),dados2[dados2[,i]>0,i],type="l", col=i)
}
points(1:length(dados2[dados2[,22]>0,1]),dados2[dados2[,22]>0,22],type="l", col=i, cex=20)
arrows(60,80000, 26, 1563)
text(40,40000, "Brazil", srt=40)
title("Casos desde a Primeira Incidência")

Se for citar este estudo utilize a seguinte referência. Salvador (2020)

Salvador, Pedro Ivo Camacho Alves. 2020. “Análise Quantitativa Da Covid19.” rPUBS 1: 1. https://rpubs.com/pedrosalvador/584906.