{"id":20864728,"url":"https://github.com/the-strategy-unit/visualising-inequalities","last_synced_at":"2025-08-11T06:19:35.346Z","repository":{"id":126887290,"uuid":"606025795","full_name":"The-Strategy-Unit/visualising-inequalities","owner":"The-Strategy-Unit","description":"R code underlying the joint Strategy Unit / British Heart Foundation (BHF) project to visualise socio-economic inequalities in the CHD pathway","archived":false,"fork":false,"pushed_at":"2023-11-30T17:29:02.000Z","size":57748,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T01:44:44.662Z","etag":null,"topics":["chd","inequalities","inequality","inequities","inequity"],"latest_commit_sha":null,"homepage":"https://www.strategyunitwm.nhs.uk/publications/socio-economic-inequalities-coronary-heart-disease","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/The-Strategy-Unit.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T12:36:20.000Z","updated_at":"2024-11-10T17:00:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c1c0700-16d4-4d18-8222-89e8a18f8954","html_url":"https://github.com/The-Strategy-Unit/visualising-inequalities","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/The-Strategy-Unit/visualising-inequalities","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Strategy-Unit%2Fvisualising-inequalities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Strategy-Unit%2Fvisualising-inequalities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Strategy-Unit%2Fvisualising-inequalities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Strategy-Unit%2Fvisualising-inequalities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The-Strategy-Unit","download_url":"https://codeload.github.com/The-Strategy-Unit/visualising-inequalities/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Strategy-Unit%2Fvisualising-inequalities/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269838521,"owners_count":24483229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chd","inequalities","inequality","inequities","inequity"],"created_at":"2024-11-18T05:44:04.012Z","updated_at":"2025-08-11T06:19:35.299Z","avatar_url":"https://github.com/The-Strategy-Unit.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\"\n)\n```\n\n# visualising-inequalities\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThis 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\n\nThe 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.\n\nIn this repository we aim to provide key sections of code to facilitate re-use on similar projects.\n\nThe first two sections of published code are the RII calculations and the calculations that assign GP practices into IMD deciles.\n\nThe next code to be published will be the shiny app and the code required to generate the RDS needed for the shiny app.\n\n\n**RII Calculations:**\n\nThe 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\n\nThe input data for this stage of the process is the rds activity_by_type_decile_stg1_testdata.rds\n\nThis 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.\nIn this example there are 32 metrics.\n\nThis test dataset has been created using a random number generator with data\nitems in a range similar to the original dataset.\n\nThe 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\n\n\n**Assign GP practices into IMD deciles:**\n\nThe 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.\n\nThe three input files are  \n1)  patients_by_lsoa_to_gp.xlsx\n      \nThe 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 :\n  \nhttps://digital.nhs.uk/data-and-information/publications/statistical/patients-registered-at-a-gp-practice/april-2022\n\n2) imd_2019.xlsx\n\nThis file contains the IMD 2019 scores, ranks and deciles for each 2011 LSOA and can be obtained from:\n\n  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\n  \n3) gp-reg-pat-prac-map-jul22.xlsx\n\nThis file maps each GP practice to a July 2022 ICB  \n\nThe output of this code is a patient weighted GP practice IMD.\n\n**Strategy Unit / British Heart Foundation (BHF) project:**\n\nThe tool is available here: https://connect.strategyunitwm.nhs.uk/content/b05b649b-511d-4921-9069-2a7a62d694dd/\n\nThe 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\u0026hash=C3933086783DC0E35F4341FEADD087DA\n\nHere is an example of the visualisation used in the tool to display the data generated using the RII calculations\n\n\u003cimg src=\"img/example-chart.png\" height=\"600\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-strategy-unit%2Fvisualising-inequalities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-strategy-unit%2Fvisualising-inequalities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-strategy-unit%2Fvisualising-inequalities/lists"}