# COVID-19 Plots and analysis relating to the pandemic 1) [Heatmaps](https://github.com/VictimOfMaths/COVID-19/tree/master/Heatmaps):
[English LA Heatmaps.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/English%20LA%20Heatmaps.R) generates heatmaps and animated maps showing English Upper Tier Local Authority trajectories in both confirmed COVID-19 cases and estimated COVID-19 deaths (in hospitals only) inspired by similar plots for US states from [@Marco_Piani](https://twitter.com/Marco_Piani). The approach to modelling deaths, which are only published at NHS trust level, was developed by [@Benj_Barr](https://twitter.com/Benj_Barr). The code also generates a map of Local Authority-level changes in case numbers in the past week and animated maps of both case and death counts.

[UK Hex Animation.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/UK%20Hex%20Animations.R) uses this data to generate an animated hex map of COVID-19 cases across the UK & Ireland, built on various excellent hex map resources from [@ODILeeds](https://twitter.com/ODILeeds) and [@olihawkins](https://twitter.com/olihawkins).

[COVIDLACaseData.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDLACaseData.R) generates similar outputs, including for hospital admissions, at Lower Tier Local Authority level. I've written about these plots in [an article](https://t.co/zNCrpC0wMw) for the journal [People, Place and Policy](https://extra.shu.ac.uk/ppp-online/)

[Scottish HB Heatmaps.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/Scottish%20HB%20Heatmaps.R), [Welsh LA Heatmaps.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/Welsh%20LA%20Heatmaps.R), [Irish County Heatmaps.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/Irish%20County%20Heatmaps.R), [German State Heatmaps.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/German%20State%20Heatmaps.R) and [COVIDCanadaHeatmap.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDCanadaHeatmap.R) produce equivalent case trajectory plots for Scottish Health Boards, Welsh Local Authorities, Irish Counties, German Bundesländer and Canadian Provinces respectively.

[COVIDCycle.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDCycle.R) visualises data on COVID-19 hospital admissions and deaths (using deaths within 24 days of a positive test, rathern than death certificate data) using [an approach](https://twitter.com/maartenzam/status/1319622943526293505) taken from [Maarten Lambrechts](https://twitter.com/maartenzam). [COVIDCycleUS](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDCycle_US.R) produces similar plots for the US as a whole and for individual states.

[COVIDPHESurveillance.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDPHESurveillance.R) and [COVIDPHESurveillance2.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDPHESurveillance2.R) provide analysis of the PHE Surveillance reports, including case data and positivity rates by age, although these have largely been replaced by [COVIDPHECasesxAgev2](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDPHECasesxAgev2.R) which generates similar plots now that age-specific case data at Local Authority level is published as part of [the PHE dashboard](http://coronavirus.data.gov.uk). [ScotlandCOVIDCasesxAge.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/ScotlandCOVIDCasesxAge.R) performs some similar analysis of case data by age for Scotland, alongside analysis of cases and deaths by deprivation quintile, while [ScotlandCOVIDHouseParties.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/ScotlandCOVIDHouseParties.R) is a small piece of analysis looking at data from Scotland on regulation-breaching house parties. Finally, [COVIDPillars.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDPillars.R) is another, obsolete, approach using older, pre-dashboard API, data to separate out case trajectories by testing pillar, while [Misc Case Analysis.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/Misc%20Case%20Analysis.R) is a collection of various quick plots related to various aspects of case data.

I've also made a couple of apps to allow you to explore local and national COVID-19 data. [One](https://victimofmaths.shinyapps.io/COVID_LA_Plots/) for mortality, cases and admissions data and [another](https://victimofmaths.shinyapps.io/COVID_Cases_By_Age/) for case data stratified by age. ![Cases heatmap](https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/COVIDLACasesHeatmap.png) 2) [All Cause Mortality](https://github.com/VictimOfMaths/COVID-19/tree/master/All%20Cause%20Mortality):
[AllCauseDeaths.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/AllCauseDeaths.R) harmonises weekly all-cause mortality data from England & Wales (from ONS), Scotland (from NRS) and Northern Ireland (from NISRA) and draws plots comparing deaths in 2020 so far to the previous decade, split by age, sex and region inspired by a plot from [@EdConwaySky](https://twitter.com/EdConwaySky).

[ScottishAllCauseDeathsDetail.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/ScottishAllCauseDeathsDetail.R) uses richer data published by NRS to look at patterns in excess mortality in Scotland by place of death, Health Board area and age. [NRS Excess Deaths by Cause.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/NRS%20Excess%20Deaths%20by%20Cause.R) produces graphs of excess deaths in Scotland by cause and location of death.

[All Cause Deaths France.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/All%20Cause%20Deaths%20France.R) uses detailed French all-cause mortality records published by [Insee](https://www.insee.fr/fr/statistiques), the French statistical authority, to examine age-specific excess deaths in France and [All Cause Deaths Italy.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/All%20Cause%20Deaths%20Italy.R) does the same for Italy using data from [ISTAT](https://www.istat.it/en/).
[AllCauseDeathsxAge.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/AllCauseDeathsxAge.R) brings these together and extends this analysis using data from the UK and international data from the [Human Mortality Database](https://www.mortality.org/).

I've made [an app](https://victimofmaths.shinyapps.io/COVID_LA_Plots/) which you can use to generate excess deaths plots by Lower Tier Local Authority for every area in Great Britain. All code and data for this lives [here](https://github.com/VictimOfMaths/COVID_LA_Plots).

I've also created [a separate app](https://victimofmaths.shinyapps.io/COVID_Reg_Delays) to allow you to explore registration delays in English and Welsh mortality data from ONS. All code and data for this lives [here](https://github.com/VictimOfMaths/COVID_Reg_Delays).

[MSOA Deaths.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/MSOA%20Deaths.R) takes mortality data from England & Wales at Middle Super Output Area level and from Scotland at Intermediate Zone level and maps it, ready for 3D visualisation using [Aerialod](https://ephtracy.github.io/index.html?page=aerialod).

[COVIDAgeMortPred.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/COVIDAgeMortPred.R) uses age-specific Case Fatality Ratios estimated by [Daniel Howden](https://twitter.com/danielhowdon) to estimate the future burden of mortality from COVID-19 infections that have already been identified (i.e. the total number of deaths we'd expect in England over the next few months *assuming there were no further infections*).

[LA All Cause Deaths.R](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/LA%20All%20Cause%20Deaths.R) calculates excess mortality at Local Authority level from ONS figures. ![Excess deaths](https://github.com/VictimOfMaths/COVID-19/blob/master/All%20Cause%20Mortality/ONSNRSNISRAWeeklyDeathsxReg.png) 3) [Exposure Mapping](https://github.com/VictimOfMaths/COVID-19/tree/master/Exposure%20mapping):
[COVIDExposures.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Exposure%20mapping/COVIDExposures.R) brings together data on health deprivation and estimates of the potential COVID-19 mortality risk based on the age-sex structure of the population (following the approach developed by [@ikashnitsky](https://twitter.com/ikashnitsky) and [@jm_aburto](https://twitter.com/jm_aburto)) at Lower Super Output Area level and plots bivariate maps highlighting areas with the greatest potential COVID-19 risk. I also made a Shiny app which creates slightly lower resolution versions of the same plots online, which you can find [here](https://victimofmaths.shinyapps.io/covidmapper/), and wrote about these maps for the UK Data Service's [Impact and Innovation blog](http://lab.ukdataservice.ac.uk/2020/05/21/visualising-high-risk-areas-for-covid-19-mortality/). ![Bivariate map](https://github.com/VictimOfMaths/COVID-19/blob/master/Exposure%20mapping/COVIDBivariateLondon.png) 4) [Initial Inequality Estimates](https://github.com/VictimOfMaths/COVID-19/tree/master/Initial%20Inequality%20Estimates):
[Estimated Cases By IMD.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Initial%20Inequality%20Estimates/Estimated%20Cases%20by%20IMD.R) takes published figures on confirmed COVID-19 cases by Local Authority in England and maps that onto quintiles of the Index of Multiple Deprivation, then plots a variety of case trajectories by deprivation quintile as well as a map of confirmed case rates. ![Quintile plot](https://github.com/VictimOfMaths/COVID-19/blob/master/Initial%20Inequality%20Estimates/COVIDQuintilesLonRate.png) 5) [Observed Inequality](https://github.com/VictimOfMaths/COVID-19/tree/master/Observed%20Inequality):
[ONS Deaths Ineq.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Observed%20Inequality/ONS%20Deaths%20Ineq.R) takes data that ONS have published for England on deaths from COVID-19 and other causes between 1st March-17th April and illustrates socioeconomic inequalities in the impact of the pandemic.

[ONS DeathsIneq 2.R](https://github.com/VictimOfMaths/COVID-19/blob/master/Observed%20Inequality/ONS%20Deaths%20Ineq%202.R) brings in historical data on socioeconomic inequalities in all-cause deaths to compare the inequality impacts of the pandemic on mortality to historical levels of inequality. ![Inequality plot](https://github.com/VictimOfMaths/COVID-19/blob/master/Observed%20Inequality/COVIDIneqRate.png) Suggested citation for any of this analysis:
Angus, Colin (2020): CoVid Plots and Analysis. The University of Sheffield. Dataset. https://doi.org/10.15131/shef.data.12328226