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

Points on opposite sides of the mean are flagged special cause when close to process limits #143

Closed ThomUK closed 2 years ago

ThomUK commented 2 years ago

Currently points such as these are flagged as special-cause because they satisfy the "2 of 3 points close to limits" rule. In this case both points are close to limits, but they are on opposite sides of the mean, so they should be reported as common-cause, not special-cause. image

This function should check that the points are both on the same side of the mean before applying a special cause flag. https://github.com/nhs-r-community/NHSRplotthedots/blob/5a4af03caff10a7ea6b8027ca72feae4b1003584/R/ptd_calculate_point_type.R#L73