Professional Documents
Culture Documents
COVID
COVID
Namaste!!
This live script / report contains the complete Data Analysis for Covid-19. The analysis can be used as a
quantitive analysis towards Novel Corona Virus.
In the analysis carried out, the data is accessed from the COVID-19 Data Repository by the Center for Systems
Science and Engineering (CSSE) at Johns Hopkins University.
Table of Contents
1. Import................................................................................................................................................................... 1
2. Filter the Data......................................................................................................................................................1
3. Plot the Filtered Data on a Map..........................................................................................................................9
4. Aggregate the Data........................................................................................................................................... 11
5. Data Analysis and Visualization........................................................................................................................ 15
Conclusions............................................................................................................................................................ 19
1. Import
The data is imported from Git repository of Johns Hopkins University. The datastore is created and new data
(future data) can be directly pulled into MABLAB through the Livescript.
% Create a datastore with parameters set by import function "importCOVIDfile" -- Expect to see
% The wildcard operator (*) allows you to select all of the .csv files in the directory
covidDatastore = datastore("csse_covid_19_data\csse_covid_19_daily_reports\*.csv","Type","file"
Warning: Unable to convert one or more variables to datetime. Specify the correct InputFormat and
DatetimeLocale properties in the DatetimeVariableImportOptions.
% Removed data from before April 07, 2020 (first 76 files) (irregularly formatted data)
covidDatastore.Files = covidDatastore.Files(77:end);
% Read data from Datastore into Workspace
dataRaw = readall(covidDatastore);
desired_date="2020-08-15 00:00:00";
1
FIPS Admin2 Province_State Country_Region Last_Update Lat
2
FIPS Admin2 Province_State Country_Region Last_Update Lat
3
FIPS Admin2 Province_State Country_Region Last_Update Lat
4
dataFiltered1 = sortrows(dataFiltered1,'Confirmed','descend')
5
FIPS Admin2 Province_State Country_Region Last_Update Lat
6
FIPS Admin2 Province_State Country_Region Last_Update Lat
7
FIPS Admin2 Province_State Country_Region Last_Update Lat
country= "India";
8
FIPS Admin2 Province_State Country_Region Last_Update Lat
geobubble(dataFiltered1,"Lat","Long_","SizeVariable","Confirmed")
title('Global Distribution of Confirmed cases for given date')
9
geobubble(dataFiltered2,"Lat","Long_","SizeVariable","Confirmed")
title('Country Level Distribution on specified date')
10
4. Aggregate the Data
A group analysis of the Contries and their States is shown. It shows the average recoveries, average deaths
and many more.
detail=groupsummary(dataFiltered1,["Country_Region","Last_Update"],["sum","mean"],["Confirmed",
detail = sortrows(detail,'sum_Confirmed','descend')
11
Country_Region Last_Update GroupCount sum_Confirmed mean_Confirmed
12
Country_Region Last_Update GroupCount sum_Confirmed mean_Confirmed
13
Country_Region Last_Update GroupCount sum_Confirmed mean_Confirmed
detail2=groupsummary(dataFiltered2,["Province_State","Last_Update"],["sum","mean"],["Confirmed"
detail2 = sortrows(detail2,'sum_Confirmed','descend')
14
Province_State Last_Update GroupCount sum_Confirmed mean_Confirmed
stackedplot(dataRaw.Last_Update,dataRaw.Confirmed)
title('Trend of total Confirmed cases globally')
15
Newfilter = dataRaw(dataRaw.Country_Region == country,:);
stackedplot(Newfilter.Last_Update,Newfilter.Confirmed)
title('Trend of Confirmed cases for selected country')
16
scatter3(Newfilter.Province_State,Newfilter.Last_Update,Newfilter.Confirmed)
title('Date wise State vs confirmed cases distribution')
17
scatterhist(detail.sum_Confirmed,detail.sum_Recovered,'group',detail.Country_Region);figure(gcf
title('Countrywise Confirmed vs Recovered cases')
scatterhist(detail2.sum_Confirmed,detail2.sum_Recovered,'group',detail2.Province_State);figure(
title('Statewise Confirmed vs Recovered cases')
18
Conclusions
From the above trends its evident that the number of covid cases in increasing exponentially. Although the
recovery rates also remained increasing. Some countries performed very well in combating the number of
cases but they got an unexpected second wave. Also, some countries were very efficient in controlling the
pandemic in initial stages but the later conditions were drastic. So, we undoubtedly need a vaccine to control
the pandemic and until then we need to take all the preventive measures at our on level.
19