tomwhite / covid-19-uk-data

Coronavirus (COVID-19) UK Historical Data
http://tom-e-white.com/covid-19-uk-data/
The Unlicense
162 stars 79 forks source link

I have experimented with rendering your csv data. #6

Closed nanjizal closed 4 years ago

nanjizal commented 4 years ago

I have experimented with rendering your csv data with canvas, you can read details of setting up if you wish to experiment with the code, you can view current online test and see the simple visual from the readme:

https://github.com/nanjizal/covid19/blob/master/README.md

Obviously more interesting renders could be created, but had to find lat/long conversion code which I ported, test and fix my low level csv parser and find lat/long data for the e number areas, related links are commented within code. If you want direct link to your repo data on readme please let me know, or if interested in further collaboration. I can also with more effort render in webgl with some depth or with svg, since I use haxe can also create mobile/desktop versions, using openfl, kha or heaps time permitting.

tomwhite commented 4 years ago

Hi @nanjizal, thanks for letting me know about your visualization. Have you tried a time lapse animation, or a way of adjusting the date, to see how the number of cases change?

nanjizal commented 4 years ago

Tom

I have updated it, it now does very simple animation and feeds off your git raw so automatically uses latest data, probably next weekend I will look to improve the visual significantly.

We should talk about improving the data with a tool that checks the file adds lat, long, os north, os east and fixes place names and e areas etc.. I currently have to do a lot of this sort of stuff, and quite a few hacks to get all the points to render. Not sure but really would be nice to break down some locations like York into their e areas, maybe there is another way to get more fine data? Do you have death and recovered data?

Would be nice to also look at mapping other countries, I can provide code to help with cleaning data and more types of graphs, platforms etc.., perhaps you could look at how we might get data for other countries?

Also I need to find a way to indicate when data was last updated via code.

Best

Justin

nanjizal commented 4 years ago

Will look to add credit to the page and links to your repo, as I try to refine the general look and feel, mainly only have proper time at weekends, I would love to extend project to other locations. Have you looked at git actions maybe you can automate your scripts?

timday commented 4 years ago

Just going to use this thread to dump a few artefacts produced from mashing up area virus case-counts with other area stats....

Areas' case-count growth rate over the last few days vs. area's old-age demographics, using 2011 census: oldies-all Doesn't seem to be much correlation at all. Surprising. Have looked at different age thresholds but this is as good as it gets.

Areas's case-count growth rate over the last few days vs. area's Leave vote in the 2016 referendum: brexit-all A bit more correlation! (Correlation not causation of course. But... what's the explanation if it's not demographics?)

And - no virus connection, but just to complete the set - area's Leave vote in the 2016 referendum vs area's old-age demographics, using 2011 census: oldies-vote-all No surprise there; I think the demographics of the Leave vote are well documented.

timday commented 4 years ago

Took a look at virus case growth rate vs the various deprivation indices from https://www.gov.uk/government/statistics/english-indices-of-deprivation-2019 . Just for England areas.

Most correlated index vs. last week's area virus case-count growth rates seemed to be "Education, Skills and Training": deprivation-Education Higher score = more deprived; 5 highest/lowest scoring areas:

  Highest
    Knowsley                        : 41.89
    Kingston upon Hull, City of     : 41.67
    Doncaster                       : 39.72
    Stoke-on-Trent                  : 38.94
    Blackpool                       : 38.50
  Lowest
    Richmond upon Thames            : 3.53
    Kensington and Chelsea          : 5.19
    Wokingham                       : 6.22
    Wandsworth                      : 6.65
    Kingston upon Thames            : 6.94

(That r=0.346 value is slightly higher than vs the Brexit Leave vote %, which has r=0.337).

Next most correlated one was "Health Deprivation and Disability": deprivation-Health 5 highest/lowest scoring areas (although in this case these highest scoring areas aren't actually high case-count growth rates, but it gives the flavour of what sort of places score highly on this index):

  Highest
    Blackpool                       : 1.64
    Knowsley                        : 1.38
    Liverpool                       : 1.35
    Manchester                      : 1.20
    St. Helens                      : 1.07
  Lowest
    Wokingham                       : -1.54
    Richmond upon Thames            : -1.37
    Kensington and Chelsea          : -1.24
    Buckinghamshire                 : -1.10
    Barnet                          : -1.07
nanjizal commented 4 years ago
ukCovid19bg

I have added a background, I originally created by hand in flash to keep vectors points low, extracted to arrays of points in 'uk' repo, I don't think the outline mapping is perfect but close enough, manually adjust scale position to match similar image mapping. The curved grid lines are drawn from looping lat/long so relate well to plotted data. Still all MIT.

timday commented 4 years ago

Looked at some interesting "health indicators" available by UTLA at https://www.ons.gov.uk/peoplepopulationandcommunity/healthandsocialcare/healthinequalities/datasets/indicatorsoflifestylesandwidercharacteristicslinkedtohealthylifeexpectancyinengland (2017 release of ~2015 data)

The last-week's cases growth rate vs. obesity rate is the most correlated and quite striking: obesity

r-value vs. other "indicators":

Correlations, highest to lowest (absolute)
  Obesity rate (%)                                  : 0.349
  Physically active adults (%)                      : -0.218
  Alcohol-related admissions (per 100,000)          : 0.180
  Adults eating 5-a-day (%)                         : -0.175
  Employment rate (%)                               : -0.173
  Economically inactive (%)                         : 0.157
  Unemployment rate (%)                             : 0.156
  Preventable Mortality (deaths per 100,000)        : 0.143
  Smoking prevalence (%)                            : 0.023
nanjizal commented 4 years ago

I have moved the latitude aspect of the code to a separate repo, the demo used is Canvas but since it's haxe the demo could be reworked for other haxe targets like OpenFL and used on mobile as c++. https://github.com/nanjizal/latLongUK