This repo contains the scripts used for creating the figures in the medium blog "Inequalities in English NHS talking therapy services: What can the data tell us?".
The scripts use the publicly available annual IAPT data published by NHS Digital and creates graphs showing variation by Index of Multiple Deprivation (IMD) deprivation decile.
- Project Description
- Data Sources
- How does it work?
- Requirements
- Getting started
- Technical Appendix
- Authors
- License
This project examines the publicly available data on the NHS IAPT (Increasing Access to Psychological Therapies) programme. Aggregate data is made available regularly and published by NHS Digital - here we take the annual data and explore the variation in the dataset, by demographic group.
Annual public aggregate IAPT data, from NHS Digital.
Cross-sectional code uses:
Longitudinal code uses:
The format and scope of the data made available by NHS Digital changes over time. The earliest available data is from 2012/13, but we have not included earlier data releases in our analysis due to limitations in its scope. Note that depending on the year, files are sometimes provided in .zip or .rar formats and will need to be extracted.
Please note: the labelling provided by NHS Digital within this dataset for IMD deprivation deciles ("01 least deprived" through to "10 most deprived") do not match the labelling used by the ONS, where the most deprived decile is labelled as decile 1, with the least deprived labelled as decile 10.
This analysis can be fully reproduced as the data for this analysis is publicly available and can be downloaded from the NHS Digital website. A series of graphs will be produced which show variation by IMD deprivation decile.
Within the project directory:
- All scripts are stored within
./R/
- The scripts expect data to be stored in
./Data/Raw_Annual_Data/
- The plots created will be saved as .pngs to
./Outputs/
These scripts are written in R (version 3.6.1 (2019-07-05) -- "Action of the Toes" was used). The following R packages are used (all available on CRAN):
- Clone this repo (for help see this tutorial).
- Raw data can be downloaded from NHS Digital
- A brief description of all scripts (contained in R) is given below:
- 00_SetUp.R - loads packages, defines functions for creating graphs
- 01_Clean_CrossSec_Depriv_Data.R - creates graphs showing variation within 2018/19 by demographic group
- 02_Clean_Longit_Depriv_Data.R - creates graphs showing variation from 2015/16 - 2018/19 by demographic group
- 03_Create_Data_Vis.R - creates plots showing variation by IMD deprivation level, both within 2018/19 and from 2015/16 - 2018/19
This repo also contains a Technical_Appendix directory which a document which supported the Health Foundation response to the government’s consultation on “Advancing our health: prevention in the 2020s”. The code used to generate these plots is contained within the R subdirectory within this folder for completeness.
- Karen Hodgson, PhD - on github / on twitter
This project is licensed under the MIT License.