Skip to content

Latest commit

 

History

History
123 lines (54 loc) · 2.43 KB

README.md

File metadata and controls

123 lines (54 loc) · 2.43 KB

Covid19 data analysis and forecasting with R

Packages used:

  1. covid19.analytics
  2. dplyr
  3. prophet
  4. lubridate
  5. ggplot2

For installing any new package in R, type the following command:

install.packages("package-name")

Here, covid19.analytics package from R is used to get covid-19 data which is internally extracted from the John Hopkins github repo for covid-19.

For covid-19 forecasting purpose, prophet package is used.


Analysis


The data for analysis is retreived from Jan 1 2020 to 30 Nov 2020. It includes data from all over the world.

1. Confirmed cases

con

2. Deaths

deaths

3. Recovered

rec

4. Aggregate

agg

5. Total cases in India

tot

6. Growth rate in India

grt

7. SIR model for India

sir

8. Trends in India

tr


Forecasting covid-19 for the next 2 months


preds

For an interactive version of this plot, click here.

Clearly, the graph does not form uniform patterns. It is only from around mid-July that a pattern is visible till present. This may have to do with varying lockdowns in states, case reporting timelines, etc.

This variability in graph is evident in the results of forecasting as:

res

The R squared values are around 42-43% which is not great accuracy. But the data is such that predictions aren't necessarily accurate.

Hence, to make more accurate predictions about the spread of Covid-19, we need more variety of data to train our model.