Giter Site home page Giter Site logo

monikasarder / melbourne-covid19-data-and-abs-variables-at-postcode-level Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 4.0 39.29 MB

Reads in COVID19 data and ABS data and normalises variables at postcode level

License: MIT License

R 0.12% HTML 99.88%
r sf plotly maps rmarkdown

melbourne-covid19-data-and-abs-variables-at-postcode-level's Introduction

Melbourne COVID19 data and ABS variables at postcode level

This repository is to enable users to reproduce the analysis underpinning the data journalism post Postcode characteristics of Melbourne’s COVID19 hotspots

The document below outlines steps undertaken to accessing, join and explore COVID19 and ABS Census characteristics at postcode level. The methods can be generalised to other projects.

Short version: to install all dependent packages, run scripts and produce report see Run all scripts and produce report.Rmd

Otherwise read the below to step through the process.

Data sources

Four data sources were used:

  • Will Mackey’s package absmaps, which makes it straightforward to download, compress and convert ABS shapefile data to sf objects in R. (Download and installation details are available from Will’s GitHub at absmaps.

  • August 6 August COVID19 data for Melbourne at Postcode level from The Age article Victoria coronavirus data: Find the number of active COVID-19 cases in your postcode, by Craig Butt and Mark Stehle. The data is available in a Google spreadsheet made available by the authors here. It is also stored in Inputs/COVID19.Confirmed.cases.20.09.06.csv

  • A user friendly Suburbs list from the Butt and Stehle article stored in Inputs/melbourne.postcode.list.csv

  • ABS Census postcode level data downloaded from the ABS website.

01 Get COVID19 data and Melb shapes.R

This script will enable you to read in COVID19 Date at postcode level, match postcodes to surburb names and visualise COVID19 on 6 August.

The plot is not meaningful story as the cumulative case numbers have not yet been rationalised for population, however it should appear as follows

The joined Melbourne shapes and COVID dataset is in Outputs/Melbourne.case.data.RDS.

02 Download ABS tables at Postcode level.R

Running this script downloads the ABS DataPack for the 2016 Census in Victoria at Postcode level.

The Census data table are mapped to a nested list named pc and each sub element is named according to its name in the Census metadata.

This object is stored in Outputs/ABS.Victoria.postcodes.RDS.

Once the file is unzipped I highly recommend reviewing the Metadata files. This is loaded into the global environoment and also available at: /2016_GCP_POA_for_Vic_short-header/2016 Census GCP Postal Areas for VIC/Metadata/Metadata_2016_GCP_DataPack.xlsx .

03 Join and Explore ABS and COVID19 data.R

This script sequentially links the COVID data file with ABS data tables and considers relationships at postcode level. The steps taken ar as follows.

  • Joins the COVID19 data with ABS table G01 Selected Person Characteristics by Sex which gives population tally for each postcode on census night. The postcode population is used to derive Cumulative Cases per 100K of residents.

  • Identifies outlier postcodes - postcodes with less than 1500 residents, and for recently developed suburbs, counts were not meaningful.

  • Creates a choropleth to verify that things look as they should.

  • Links normalised COVID19 data and runs Pearson correlation against:

    • G01: Selected Person Characteristics by Sex normalised by Persons;
    • G51: Industry of Employment by Age by Sex normalised by employed persons aged 15 years and over
    • G17: Total Personal Income (Weekly) by Age by Sex normalised by Persons aged 15 and over;
    • G33: Tenure Type and Landlord Type by Dwelling Structure normalised by occupied private dwellings;
    • G32: Dwelling Structure normalised by persons in occupied private dwelling;
    • G37: Dwelling Internet Connection by Dwelling Structure normalised by occupied private dwellings;
    • G02: Selected Medians and Averages normalised by Persons; and
    • G53: Industry of Employment by Occupation normalised by employed persons aged 15 years and over.

COVID19 data and normalised variables along with spatial information are saved in Outputs/Melbourne.spatial.COVID19.RDS.

04 REPORT Demographic.community.spread.Rmd

This Rmarkdown script reproduces the data blog post at Deploy the data entitled Postcode characteristics of Melbourne’s COVID19 hotspots.

Please let me know if you have any questions or improvements at [email protected] .

melbourne-covid19-data-and-abs-variables-at-postcode-level's People

Contributors

monikasarder avatar robjhyndman avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.