-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chris_Mainey_presentation.Rmd
446 lines (292 loc) · 10.3 KB
/
Chris_Mainey_presentation.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
---
title: "Analytics & Measurement in Patient Safety"
subtitle: "A wander through my personal experience and work in the NHS"
author:
- "Chris Mainey"
date: '`r Sys.Date()`'
output:
xaringan::moon_reader:
seal: false
css: theme.css
nature:
slideNumberFormat: "%current%/%total%"
highlightStyle: github
highlightLines: true
ratio: 16:9
countIncrementalSlides: true
---
```{r setup, include=FALSE}
library(ragg)
library(RefManageR)
BibOptions(check.entries = FALSE, bib.style = "authoryear", style = "text",
dashed = FALSE, cite.style="authoryear", longnamesfirst=FALSE)
#file.name <- system.file("Bib", "", package = "RefManageR")
bib <- ReadBib("References.bib")
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(
fig.width=9, fig.height=3.5, fig.retina=3,
out.width = "100%",
cache = FALSE,
echo = TRUE,
message = FALSE,
warning = FALSE,
hiline = TRUE,
dev = "ragg_png"
)
```
```{r R-Lang, echo=FALSE}
# Choose the language at the beginning of your script or knit from external file
lang <- c("EN", "FR")[1]
```
class: title-slide
# Analytics & Measurement in Patient Safety
<br><br>
### A wander through my personal experience
### and work in the NHS
<br><br>
### <img src="./assets/img/crop.png" alt="Mainard icon" height="40px" /> Dr Chris Mainey
`r icons::icon_style(icons::fontawesome("envelope"), fill = "#005EB8")` [c.mainey@nhs.net](mailto:c.mainey@nhs.net)
`r icons::icon_style(icons::fontawesome("twitter"), fill = "#005EB8")` [@chrismainey](https://twitter.com/chrismainey)
`r icons::icon_style(icons::fontawesome("github"), fill = "#005EB8")` [chrismainey](https://github.com/chrismainey)
`r icons::icon_style(icons::fontawesome("linkedin"), fill = "#005EB8")` [chrismainey](https://www.linkedin.com/in/chrismainey/)
`r icons::icon_style(icons::fontawesome("orcid"), fill = "#005EB8")` [0000-0002-3018-6171](https://orcid.org/0000-0002-3018-6171)
`r icons::icon_style(icons::fontawesome("globe"), fill = "#005EB8")` [www.mainard.co.uk](https://www.mainard.co.uk)
.footnote[Presentation and code available: **https://github.com/chrismainey/PS_measurement**]
.art_cap[R generative art - inspired by Antonio Sánchez Chinchón - @aschinchon]
---
class: inverse center middle
.pull-left[
<br>
## Background, and progression to this role
]
.pull-right[
<img src="https://media1.giphy.com/media/H5Ax4wLi7D7Elausl4/giphy.gif?cid=790b7611e64490feb1ebb99c89c34c151f68560728d983ec&rid=giphy.gif&ct=g" width="480" height="270"></img>
]
---
# Analytical career
+ Didn't start as an analyst
--
+ Public Health - Cancer registry -> on to "Cancer Network."
--
+ Acute trust informatics - exposure to production databases
--
+ Progression to senior analyst
+ Responsible for statistics models
+ Started MPH course
--
+ PhD in applied statistics and ML, on how to use incident reporting data
--
+ Developed Senior Data Scientist role and Data Science team + external relationships
--
+ Taken role in National Patient Safety Team
---
# Essential experience
.pull-left[
+ Excel
+ Relational Databases:
+ Structure
+ SQL
+ Summary Statistics
+ Data Visualisation
+ Dashboarding
+ Presentation to others
<br>
__It's OK to not understand everything, but work with people who do...__
]
.pull-right[
<img src="https://lovestats.files.wordpress.com/2012/07/low-error-rate-meme.jpg" height="350">
]
---
# Better Skills:
.pull-left[
+ Asking the right question
+ Sector knowledge / dataset knowledge
+ Study design / how to answer questions
+ Analytical programming language e.g. R or Python
+ Statistical analysis / Modelling / Machine learning methods
+ Collaborative working
+ With other disciplines / clinical colleagues
<br>
__You can't be good at everything, specialising is good__
]
.pull-right[
<img src="http://37.media.tumblr.com/tumblr_m0w7ccQomh1rpjhxuo1_400.jpg" height="350">
]
---
# Top skills:
.pull-left[
+ Designing measurement / analytical plans
+ Balancing detail / signal and story
+ Reproducible Analytical Pipelines (RAP) / MLops / DataOps
+ Communicating uncertainty in analysis
+ Ability to apply emerging methods
+ __Causal Inference__
<br>
__Too many specialties...can't keep up with everything...__
]
.pull-right[
<img src="https://lovestats.files.wordpress.com/2012/07/what-if-i-told-you-research-methods-meme.jpg" height="350">
]
---
class: inverse middle
# National Patient Safety Team at NHSEI
---
## The Patient Safety Strategy
<p align="center"><img src="./assets/img/PSStrategy.png" height="470"></p>
.footnote[
https://www.england.nhs.uk/patient-safety/the-nhs-patient-safety-strategy/#patient-safety-strategy
]
---
class: inverse middle
## Workstream 1: Analysis of incident reporting data
---
## Using incident reporting data
### "Patient Safety I"
+ Harvard Medical Practice Study
+ IoM: To Err is Human
+ NHS: An Organisation with a Memory
> “Organisations should demonstrate that they have in place fully functional reporting systems for serious incidents, that staff know how to use them, that the systems are used, and that appropriate action is taken in response to incidents, including provision of appropriate support to the affected patients and their carers.” -Berwick, D (2013)
.footnote[Berwick D. A Promise to Learn—a Commitment to Act: Improving the Safety of Patients in England. London: Department of Health; 2013;6.]
--
<br>
+ Clinical (qualitative review) is major method
+ Quantitative approaches being reduced deliberately
+ Finding relevant incidents is a key question
+ Natural Language Processing (NLP)
---
class: inverse middle
## Workstream 2: Measurement for the Patient Safety Improvement Programmes (SIPs)
---
.pull-left[
## QI & SIPs
+ Quality Improvement now established as a discipline, with it's methods: PDSA cycle & variations: (Lean / Six-sigma etc.)
+ Difficult for analysts to appreciate differences in monitoring, improvement, assurance etc.
{{content}}
]
.pull-right[
<p align="center"><img src="http://www.apiweb.org/images/model.png" alt="IHI and API improvement process diagram"></p>
__IHI and API improvement process diagram: http://www.apiweb.org/__
]
--
+ 'Quality' and 'Patient Safety' something of a pseudo-science:
+ Psychology
+ Human Factors
+ Process control (Shewhart / Deming)
{{content}}
--
+ Contrasts with Donabedian model:
+ Structures
+ Process
+ Outcomes
---
# Methods
+ Depends the question!!!
.pull-left[
### Run charts & SPC
```{r spc, echo=FALSE, fig.height=4, fig.width=6, message=FALSE, warning=FALSE}
library(NHSRplotthedots)
library(NHSRdatasets)
library(tidyverse)
sub_set <- ae_attendances %>%
filter(org_code == "RQM", type == 1, period < as.Date("2018-04-01"))
sub_set %>%
ptd_spc(value_field = breaches, date_field = period, improvement_direction = "decrease")
```
]
.pull-right[
### Funnel Plots
```{r funnel, echo=FALSE, fig.height=4, fig.width=6, message=FALSE, warning=FALSE}
library(FunnelPlotR)
library(COUNT)
library(ggplot2)
# lets use the 'medpar' dataset from the 'COUNT' package. Little reformatting needed
data(medpar)
medpar$provnum<-factor(medpar$provnum)
medpar$los<-as.numeric(medpar$los)
# Build glm to predict los (count so Poisson assumption)
mod<- glm(los ~ hmo + died + age80 + factor(type), family="poisson", data=medpar)
# Predict on to dataset
medpar$prds<- predict(mod, type="response")
b<-funnel_plot(numerator=medpar$los, denominator=medpar$prds, group = medpar$provnum, data_type = "SR",
title = 'Length of Stay Funnel plot for `medpar` data', draw_unadjusted = FALSE,
draw_adjusted = TRUE, sr_method = "SHMI", label="outlier", limit=99)
b <- plot(b) +
guides(color=guide_legend(nrow=2, byrow=TRUE))+
theme(panel.grid = element_line(color = "grey70")
, plot.background = element_rect(color = "grey", size = 1) # border around whole plot
, plot.margin = unit(c(5, 5, 5, 5), "mm"))
print(b)
```
]
---
## Methods
.pull-left[
+ __Statistical analysis:__
+ Hypothesis testing
+ Generalized Linear Modelling (e.g linear regression, logistic regression)
+ Multilevel Models (GLMM, random-intercept)
+ Time series (e.g. ETS or ARIMA)
+ Generalized Additive Models (GAMs)
]
.pull-right[
+ __Causal Inference:__
+ Consider causal pathway!!!
+ Temporal Order
+ Confounders, Mediators etc.
{{content}}
]
<br><br>
<p align = "center"><img src="https://imgs.xkcd.com/comics/correlation.png"><br>
<a href="https://xkcd.com/552/">https://xkcd.com/552/</a></p>
--
+ Difference-in-Difference
+ Regression Discontinuity analysis
---
class: middle inverse
# Example: NEWS2 Deterioration Scores and mortality
---
## Current progress on Causal Path
<p align = "center"><img src="./assets/img/dagitty-model2.png" height="360"></p>
> _"...Since all models are wrong the scientist must be alert to what is importantly wrong. It is inappropriate to be concerned about mice when there are tigers abroad..."_ Box, GEP (1976)
.footnote[Box, G. E. P. (1976). "Science and Statistics". In: Journal of the American Statistical Association 71.356, pp. 791-799. DOI: 10.1080/01621459.1976.10480949. URL: https://www.tandfonline.com/doi/abs/10.1080/01621459.1976.10480949.]
---
# Summary
.pull-left[
### Developmental:
+ Get experience in different areas to build your skills
+ Takes time to get experience, don't move too fast
{{content}}
]
--
+ Think about your skill set, and whether new skills will deliver better results
+ Remember it is about the message, despite the importance of detail
--
.pull-right[
### NHS Patient Safety:
+ Using incident reporting data to learn and build safer systems
+ Clinical review is bottle-neck
+ NLP methods can help provide targets
{{content}}
]
--
+ Measuring improvement is an imperfect thing:
+ Change over time or comparison against standards are main methods
+ Over-reliance on SPC or run-chart
+ All success is interpreted as due to programmes
--
+ __We can do better:__
+ Properly designed study conditions: e.g. stepped-wedge trials
+ Causal Inference
---
class: inverse center middle
.pull-left[
<img src="https://imgs.xkcd.com/comics/curve_fitting.png" alt="XKCD Curve-fitting" height="600px" />
]
.pull-right[
<br><br><br><br><br>
## It's all about the message!!
<br><br><br><br>
__Source:__ xkcd: A webcomic of romance, sarcasm, math, and language
'Curve-Fitting Methods and the messages they send'
https://xkcd.com/2048/
]