Skip to content

Commit 0c2bc60

Browse files
authored
Merge pull request #25 from humaniverse/respiratory-conditions
First draft completed - respiratory-conditions
2 parents f6e3f9d + c70b09d commit 0c2bc60

File tree

5 files changed

+84
-2
lines changed

5 files changed

+84
-2
lines changed

R/data.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,24 @@
355355
#' @source \url{https://data.nisra.gov.uk/}
356356
"places_household_overcrowding"
357357

358+
#' Percentage Rate of Respiratory Conditions (Asthma and COPD) (2023/2024)
359+
#'
360+
#' A dataset containing statistics on the percentage of people who self-reported
361+
#' as having asthma and/or COPD in Northern Irish Council Areas.
362+
#'
363+
#' @format A data frame with 11 rows and 3 variables:
364+
#' \describe{
365+
#' \item{ltla24_code}{Local Authroity Code}
366+
#' \item{respiratory_conditions_percentage}{Percentage of people who self-reported
367+
#' as having asthma and/or COPD}
368+
#' \item{year}{Time period - financial year}
369+
#'
370+
#' ...
371+
#' }
372+
#' @source \url{https://data.nisra.gov.uk/}
373+
#'
374+
"people_respiratory_conditions"
375+
358376
#' Rates of Personal Crime per 1,000 (2017)
359377
#'
360378
#' A dataset containing statistics on 'personal crime' per 1,000 people in
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Respiratory conditions here pertains to asthma and COPD data. A mean average
2+
# has been calculated between the 2 to get an average for respiratory conditions.
3+
# This best matches how England's Health Index calculates their respiratory
4+
# conditions indicator.
5+
6+
# ---- Load packages ----
7+
library(tidyverse)
8+
9+
# ---- Get and clean data ----
10+
# Respiratory Conditions
11+
# Source: https://data.nisra.gov.uk/
12+
13+
url <- "https://ws-data.nisra.gov.uk/public/api.restful/PxStat.Data.Cube_API.ReadDataset/DISPREVLGD/CSV/1.0/"
14+
respiratory_conditions_raw <- read_csv(url)
15+
16+
people_respiratory_conditions <- respiratory_conditions_raw |>
17+
filter(
18+
`Statistic Label` == "Raw disease prevalence per 1,000 patients",
19+
`Financial Year` == "2023/24",
20+
`Disease` %in% c("Asthma", "Chronic Obstructive Pulmonary Disease"),
21+
`LGD2014` != "N92000002"
22+
) |>
23+
group_by(LGD2014) |>
24+
mutate(
25+
respiratory_conditions_prevalence = mean(VALUE, na.rm = TRUE),
26+
respiratory_conditions_percentage = (respiratory_conditions_prevalence / 10)
27+
) |>
28+
ungroup() |>
29+
distinct(LGD2014, .keep_all = TRUE) |>
30+
select(
31+
ltla24_code = LGD2014,
32+
respiratory_conditions_percentage,
33+
year = `Financial Year`
34+
)
35+
36+
# ---- Save output to data/ folder ----
37+
usethis::use_data(people_respiratory_conditions, overwrite = TRUE)
392 Bytes
Binary file not shown.

man/people_respiratory_conditions.Rd

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metadata.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
| Healthy People | Diabetes | ? | [NISRA](https://datavis.nisra.gov.uk/dissemination/NINIS-redirect.html) | [OGL3](https://www.nisra.gov.uk/crown-copyright) | :heavy_exclamation_mark: Data currently unavailable. Raw disease prevalence only shows data per 1,000 (England's Health Index uses %). Other alternative could be 'Prescriptions for drugs used to treat Diabetes (administrative geographies) (4), but need to contact info.bso@hscni.net to check. Review at the end. | :x: |
5252
| Healthy People | Kidney and Liver Disease | :x: | :x: | :x: | :x: Data unavailable. | :x: |
5353
| Healthy People | Musculoskeletal Conditions | :x: | :x: | :x: | :x: No data available | :x: |
54-
| Healthy People | Respiratory Conditions: Asthma | 2023-24 | [NISRA](https://data.nisra.gov.uk/) | [OGL3](https://www.nisra.gov.uk/crown-copyright) | :heavy_exclamation_mark: Data only available for raw prevalence rate. Percentage required to best match England's Health Index. Respiratory Conditions is treated as 1 indicator. | :x: |
55-
| Healthy People | Respiratory Conditions: COPD | 2023-24 | [NISRA](https://data.nisra.gov.uk/) | [OGL3](https://www.nisra.gov.uk/crown-copyright) | :heavy_exclamation_mark: Data only available for raw prevalence rate. Percentage required to best match England's Health Index. Respiratory Conditions is treated as 1 indicator. | :x: |
54+
| Healthy People | Respiratory Conditions: Asthma & COPD | 2023-24 | [NISRA](https://data.nisra.gov.uk/) | [OGL3](https://www.nisra.gov.uk/crown-copyright) | :heavy_check_mark: Indicator: Percentage rate of people self-reported as having asthma and/or COPD. | :heavy_check_mark: |
5655
| Healthy Places | Private Outdoor Space | :x: | :x: | :x: | :x: Data unavailable. | :x: |
5756
| Healthy Places | Public Green Space | :x: | :x: | :x: | :heavy_exclamation_mark: Indicator not overtly present in England's Health Index. To review at the end. | :x: |
5857
| Healthy Places | Household Overcrowding | 2017 | [NISRA](https://data.nisra.gov.uk/) | [OGL3](https://www.ninis2.nisra.gov.uk/public/terms.aspx) | :heavy_check_mark: Indicator: Percentage of households experiencing overcrowding| :heavy_check_mark: |

0 commit comments

Comments
 (0)