Giter Site home page Giter Site logo

the-strategy-unit / visualising-inequalities Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 56.39 MB

R code underlying the joint Strategy Unit / British Heart Foundation (BHF) project to visualise socio-economic inequalities in the CHD pathway

Home Page: https://www.strategyunitwm.nhs.uk/publications/socio-economic-inequalities-coronary-heart-disease

License: MIT License

R 100.00%
chd inequalities inequality inequity inequities

visualising-inequalities's Introduction

visualising-inequalities

This repository is aimed at sharing the R code underlying the joint Strategy Unit / British Heart Foundation (BHF) project to visualise socio-economic inequalities along the CHD pathway

The project included development of a new tool, built using Shiny and aimed at helping Integrated Care Boards (ICBs) get an overview of the points on the care pathway where inequalities emerge and are amplified.

In this repository we aim to provide key sections of code to facilitate re-use on similar projects.

The first two sections of published code are the RII calculations and the calculations that assign GP practices into IMD deciles.

The next code to be published will be the shiny app and the code required to generate the RDS needed for the shiny app.

RII Calculations:

The code rii_calculations.R can be used to calculate the RII with lower and upper confidence intervals and with a confidence interval determined within the code

The input data for this stage of the process is the rds activity_by_type_decile_stg1_testdata.rds

This data has a row for each IMD decile. The first column is the IMD decile number, the second column is the total GP list size for that decile. Each of the other columns is the total activity for that metric and decile. In this example there are 32 metrics.

This test dataset has been created using a random number generator with data items in a range similar to the original dataset.

The output of this stage of the process is sii_table which contains one row per metric and columns for SII, UCI, LCI, RII, UCI_RII, LCI_RII and RR

Assign GP practices into IMD deciles:

The code calculate_gpprac_imd_deciles.R takes three xlsx files as inputs and generates a GP practice list with each practice assigned to an IMD decile and a July-2022 ICB.

The three input files are

  1. patients_by_lsoa_to_gp.xlsx

The file here is from January 2020, used in this project as the GP practice list sizes timeframe is consistent with much of the data used for the metrics and is also pre-pandemic. The file contains practice list sizes split by LSOA. The latest version of this file can be obtained from :

https://digital.nhs.uk/data-and-information/publications/statistical/patients-registered-at-a-gp-practice/april-2022

  1. imd_2019.xlsx

This file contains the IMD 2019 scores, ranks and deciles for each 2011 LSOA and can be obtained from:

https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/845345/File_7_-_All_IoD2019_Scores__Ranks__Deciles_and_Population_Denominators_3.csv/preview

  1. gp-reg-pat-prac-map-jul22.xlsx

This file maps each GP practice to a July 2022 ICB

The output of this code is a patient weighted GP practice IMD.

This code makes use of regular expressions. More details about them can be found in this NHS-R blog here:

https://nhsrcommunity.com/code-snippets-regular-expressions/

Strategy Unit / British Heart Foundation (BHF) project:

The tool is available here: https://connect.strategyunitwm.nhs.uk/content/b05b649b-511d-4921-9069-2a7a62d694dd/

The accompanying report including methodology and a recording of a webinar about the tool is available here: https://www.bhf.org.uk/-/media/files/publications/research/bhf_visualising-socio-economic-inequalities-in-chd-progression-and-pathways_sept2022.pdf?rev=e43c10defd7a4579a2795887d6728b37&hash=C3933086783DC0E35F4341FEADD087DA

Here is an example of the visualisation used in the tool to display the data generated using the RII calculations

visualising-inequalities's People

Contributors

jacgrout avatar lextuga007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lextuga007

visualising-inequalities's Issues

Links to public data snapshots in data folder in README

Would be really useful to have links to the IMD 2019 and GP practice July 2022 ICB in the README as these aren't always widely known and can help locate the original files. It's something I always struggle with ๐Ÿ˜ƒ

Write the readme

  • Write the readme include project history and tech explaination

Code change to match Shiny Tool

Code published so far does not match the BHF tool as this version does not allow flexing of confidence intervals

Replace the RII calculation section of code with a version that includes an option to set your own confidence interval

Add licence

Are the funders happy with an open licence? Happy to advise on this if they are

Make test data more realistic

Test data needs to be ordered to reflect the real life data to better demonstrate the inequalities and inequities found in the original project

  • Manually recreate test data in RDS format

  • Create and share code to auto create test data

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.