encuentRo2020
JJ Merelo, @jjmerelo
world.data.filtered$CFR <- world.data.filtered$Deaths / world.data.filtered$Cases # Igual a los fallecimientos divididos por el número de casos.
ggplot(world.data.filtered, aes(x=Date,y=CFR,color=Country.Region,group=Country.Region))+ ggtitle("Evolution of CFR from February for selected countries")+ geom_line()+theme_tufte()+theme(legend.position = "bottom")
KO.data <- world.data[world.data$Country.Region=="Korea, South",]
ccf(KO.data$New.Cases, KO.data$New.Deaths,lag.max = 35, main=c("KO cross-correlation", "New cases vs. deceases"), xlab ='Lag', ylab='Cross-correlation')
data$cap <- 155000
data$floor <- 1
model.logistic <- prophet(data, growth='logistic')
future.logistic <- make_future_dataframe(model.logistic, periods=30)
future.logistic$cap <- 155000
future.logistic$floor <- 1
forecast.logistic <- predict(model.logistic,future.logistic)
forecast.logistic$ds <- as.Date(forecast.logistic$ds, "%Y-%m-%d")
merged.data$diff.fallecimientos <- merged.data$fallecimientos.ahora - merged.data$fallecimientos
ggplot(merged.data, aes(x=fecha, y=diff.fallecimientos))+geom_point()+theme_tufte()+theme(axis.text.x = element_text(angle = 90))
Imagen de Pinterest