Skip to content

This is a project which takes in the John Hopkins covid-19 data and performs analysis on it as well as predicts the spread of the virus from Dec 2020 to Jan 2021.

Notifications You must be signed in to change notification settings

adityarc19/covid19-with-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.


About

This is a project which takes in the John Hopkins covid-19 data and performs analysis on it as well as predicts the spread of the virus from Dec 2020 to Jan 2021.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages