Skip to contents

Returns data for the Inequalities Markers Time Series chart for the provided indicator ID and area ID. Data contains information about the chosen target value as well as an array InequalityMarkers which contains all the time series data grouped into metric category types e.g. age group, ethnicity, etc.

Usage

cvd_indicator_person_timeseries(indicator_id = 1, area_id = 1)

Arguments

indicator_id

integer - the indicator to return data for (compulsory)

area_id

integer - the area to return data for (compulsory)

Value

Tibble of metric performance for the specified indicator in the area

Details

CVD Prevent API documentation: Indicator person time series

Examples

# View the details of the time-series performance for indicator 'AF:
# treatment with anticoagulants' (ID 7) in Salford South East PCN (area ID
# 705), focussed just on the age group inequalities metrics:
cvd_indicator_person_timeseries(indicator_id = 7, area_id = 705) |>
  dplyr::filter(
    MetricCategoryTypeName == 'Age group',
    !is.na(Value)
  ) |>
  dplyr::select(MetricCategoryName, TimePeriodName, TimePeriodID, Value) |>
  tidyr::pivot_wider(
    names_from = MetricCategoryName,
    values_from = Value
  )
#> # A tibble: 11 × 5
#>    TimePeriodName    TimePeriodID `40-59` `60-79` `80+`
#>    <chr>                    <int>   <dbl>   <dbl> <dbl>
#>  1 To March 2020                1    78.3    82.3  85  
#>  2 To March 2021                2    91.3    82.3  84.8
#>  3 To September 2021            3    78      86.9  87.2
#>  4 To March 2022                4    76.6    86.8  90.2
#>  5 To June 2022                 5    82.4    86.8  88.6
#>  6 To September 2022            6    80      86.6  90.6
#>  7 To December 2022             7    76.3    87.5  90.6
#>  8 To March 2023                8    72.7    87.4  91.1
#>  9 To June 2023                 9    71.1    88.5  91.3
#> 10 To December 2023            15    74.4    88.9  90.6
#> 11 To March 2024               17    80.5    91.5  92.4