bk75R / PHE_NASSS_Cardiac

Extracting and tidying up data from graphs in the National Ambulance Syndromic Surveillance System (England)
The Unlicense
0 stars 0 forks source link

Interpolate between points to find full sum of calls for baseline and 7 day average #1

Closed bk75R closed 2 years ago

bk75R commented 2 years ago

PHS_NASSS_Cardiac_WebPlotDigitizerSaveData.R uses (for example)

cardiac.2020 %>%
  summarise(Daily = sum(SevenDayAverage,na.rm = TRUE),Baseline = sum(Baseline))

This just sums the data extracted using WebPlotDigitizer - this isn't the full sum of calls.

The code should interpolate (spline?) between extracted points to find full daily calls for baseline and 7 day average.

bk75R commented 2 years ago

Used approx() to interpolate between data read by WebPlotDigitizer and revised code to produce summaries based on this.

> cardiac.2020.summary
     Daily Baseline
1 95162.36  86297.4
> cardiac.2021.summary
     Daily Baseline
1 107882.8 93720.44
> cardiac.2022.summary
     Daily Baseline
1 127978.4 121851.1