anhoej / qicharts2

R package: Quality improvement charts
38 stars 12 forks source link

Prime correction - screen moving ranges before calculation #36

Closed andrjohns closed 2 years ago

andrjohns commented 2 years ago

According to Provost & Murray (2011), when calculating the correction factor for u-prime and p-prime charts from the z-score moving ranges, these moving ranges should first be screened for outliers - as is done for the i-chart:

image

This PR adds that screening to the p-prime and u-prime chart calculations

Provost, L. P., & Murray, S. (2011). The health care data guide: learning from data for improvement. John Wiley & Sons.

anhoej commented 2 years ago

Thanks again, Andrew. Please test and report.

I guess screening moving ranges before calculating AMR is debatable. Provost and Murray recommend this, but Laney - who inveted prime charts - does not. Nonetheless, I agree that if we screen MR for I charts, we should do it for prime charts also. Maybe we should make MR screening an option (e.g. options('qic.screen.mr')). Any opinions on that?

huftis commented 2 years ago

Donald J. Wheeler strongly recommends against screening/removing outliers. See, for example:

So if screening is implemented, there should be option to disable it (or, preferable, to enable it, i.e., the default being disabled). And by option, I mean a function argument, not an options() option. The value of options() should never affect computation, cf. https://design.tidyverse.org/args-hidden.html.

anhoej commented 2 years ago

Very good point, huftis. I guess the jury is still out on screening moving ranges. For consistency reasons, I'll keep screening in I, PP and UP charts for now. But I'll probably make it optionally in the future. The only thing that worries me is the constant groth in qic() function arguments :)