nhs-r-community / NHSRplotthedots

An SPC package to support NHSE/I 'Making Data Count' programme
https://nhs-r-community.github.io/NHSRplotthedots/
Other
48 stars 23 forks source link

fix colour of points in trends #180

Closed tomjemmett closed 1 year ago

tomjemmett commented 1 year ago

fixes #171 and #122. Currently we colour points based on whether the point is above the mean or below it (taking into account the direction). However, if you have a trend of 7 points that are above the mean line, but all trending down (with a direction of increase being good) previously this would be flagged as improvement when these are infact a decreasing trend.

in resolving this I've also tackled #122 by adding a column which indicates the rule that caused the point to be flagged in the following order

  1. if a point is above/below the 3 sigma limits
  2. if a point is part of an increasing/decreasing trend
  3. if a point is part of a series of 2 in 3 points close to the control limits
  4. if a point is part of 7 points one side of the mean
tomjemmett commented 1 year ago

following conversation with @ThomUK at NHS-R conf 23, merging