knitr::opts_chunk$set(echo = FALSE, message = FALSE)

pacman::p_load(
  magrittr,
  dplyr,
  knitr,
  kableExtra
)

Summary

The covid19.nhs.data package contains four many-to-many (overlapping) mappings between local authority districts (upper- and lower-tier) and NHS Acute Trusts in England. Each mapping contains the following variables:

These mappings are probabilistic estimates based on Secondary Uses Service (SUS) healthcare data for England (January - September 2020, inclusive), and linked COVID-19 cases and admissions (June 2020 - May 2021, inclusive). Please see the vignette "Creating the public mappings" for details of how the mappings are made.

These mappings can be used to estimate COVID-19 hospital admissions at the local authority level, or to estimate "relevant" community COVID-19 cases for an NHS Trust. These are estimates only and may not accurately reflect the truth; see limitations below.

Usage

Get started

Install the package from GitHub:

devtools::install_github("epiforecasts/covid19.nhs.data")

and load the library:

library(covid19.nhs.data)

Access the mappings

Access the mappings with load_mapping(), specifying the geographical scale ("ltla" or "utla") and the data source ("sus" or "link"):

load_mapping(scale = "ltla", source = "link") %>%
  head() %>%
  kable() %>%
  kable_styling()

Add Trust names and local authority names to the raw mapping with get_names():

load_mapping(scale = "ltla", source = "link") %>%
  get_names(geo_names = ltla_names) %>%
  head() %>%
  kable() %>%
  kable_styling()

Summarise the mapping with summarise_mapping(). For an NHS Trust (specified by the argument trust), this will return a table and a visualisation, both describing p_trust:

mapping <- load_mapping(scale = "ltla", source = "link")
summary <- summarise_mapping(trust = "RYR",
                             mapping = mapping,
                             shapefile = england_ltla_shape,
                             geo_names = ltla_names)

summary$summary_table %>%
  kable() %>%
  kable_styling()

summary$summary_plot

For a local authority (specified by the argument geography), this will return a table describing p_trust:

summary <- summarise_mapping(geography = "E09000012",
                             mapping = mapping,
                             shapefile = england_ltla_shape,
                             geo_names = ltla_names)

summary$summary_table %>%
  kable() %>%
  kable_styling()


epiforecasts/covid19.nhs.data documentation built on Sept. 29, 2022, 3:19 a.m.