Sign in

Neil Pettinger

@kurtstat.bsky.social
440 followers 791 following 913 posts

Healthcare data analyst. Aspiring Munroist.

PostsRepliesMedia
Neil Pettinger @kurtstat.bsky.social · 30/09/2026
I had the idea of visualizing the trend in >12-hour ED stays in the same way the BBC visualizes small boat arrivals. So these are cumulative weekly totals for each (colour-coded) year as we move from left to right. The projection for the remaining 14 weeks of 2026 is mine.
001
Neil Pettinger @kurtstat.bsky.social · 13/05/2026
This chart (together with its provocative title!) captures some of my anxieties. Emergency Departments in the UK are supposed to meet a 95% target for this metric. There is not a single hospital in the land that is even close to 95%. Yet I'm pretty sure they all monitor it using charts like this.
100
Neil Pettinger @kurtstat.bsky.social · 06/05/2026
Data conversations need to take place between managers and data analysts. But managers don't initiate them because they have an antipathy towards data. And data analysts don't initiate them because they have an antipathy towards conversations.
This is a cross between a graph and a diagram. The horizontal axis is labelled "domain knowledge". The vertical axis is labelled "data knowledge". There's a blue square (labelled "Data analysts") positioned in the graph's top left quadrant and a red square (labelled "Managers") positioned in the graph's bottom right quadrant. Between the two squares is a double-pointed arrow labelled "Data conversations".
000
Neil Pettinger @kurtstat.bsky.social · 02/03/2026
When we want to describe how an AMU affects its patients' prior length of stay in the ED, 'heaviness' explains it better than fullness. But 'stickiness' explains it even better.
000
Neil Pettinger @kurtstat.bsky.social · 23/10/2025
My AMU 'heaviness' metric came about after I tried showing AMU lengths of stay so far (ALoSSF) as horizontal timelines on top of each other. On the left: a snapshot that captured 60 patients with an ALoSSF of 24.6 hours. On the right: 58 patients with an ALoSSF of 37.8 hours. #rstats #ggplot2
060
Neil Pettinger @kurtstat.bsky.social · 23/10/2025
I want to have a go at adapting Stuart Hall's encoding/decoding model so that it works for how healthcare data messages are communicated. I think the key to this is how I flesh out the meaning structures on each side of the diagram.
Stuart Hall's encoding/decoding model (adapted from his 1973 essay) made to look a bit smarter with blue and pink text boxes.
040
Neil Pettinger @kurtstat.bsky.social · 22/10/2025
I'm hoping that - eventually - *everyone* involved in acute hospital patient flow will be talking about AMU 'heaviness'! (Meanwhile I can't work out if this chart is a volcano metaphor or a Pandora's Box metaphor...) #rstats #ggplot2
A scatterplot showing the relationship between Acute Medical Unit (AMU) 'heaviness' (measured along the horizontal axis) and Emergency Department (ED) length of stay (measured up the vertical axis). 366 overlapping grey dots in the chart represent the 366 days of the year. A "green zone of flow" has been (arbitrarily) drawn in the bottom left of the chart.
NOTE: AMU 'heaviness' is calculated as each day's average number of occupied beds multiplied by each day's average length of stay so far.
040
Neil Pettinger @kurtstat.bsky.social · 21/10/2025
Acute Medical Unit (AMU) 'heaviness' scores are calculated by multiplying each day's AMU mean lengths of stay by the same day's AMU fullness snapshots. The scores are closely correlated with Emergency Department (ED) performance, so I thought a scatterplot would be the way to go. #rstats #ggplot2
A scatterplot showing the relationship between Acute Medical Unit (AMU) 'heaviness' (measured along the horizontal axis) and Emergency Department (ED) length of stay (measured up the vertical axis). Two red dots in the chart represent the 'worst' day of the year (23 Jan 2024, when four-hour compliance was 40%) and the 'best' day of the year (23 Jun 2023, when four-hour compliance was 79%). A "grey zone of flow" has been (arbitrarily) drawn in the bottom right of the chart.
151
Neil Pettinger @kurtstat.bsky.social · 21/10/2025
Here's the graph after the correction. I'm trying out different ways of showing how a specialty's inpatients get more displaced as its workload increases. As @em-dr-jacklin.bsky.social might put it: the fuller the specialty, the greater the "wrongward-ness". #rstats #ggplot2
A scatterplot showing the relationship between occupied beds (along the horizontal axis) and no. of "wrong" wards used (up the vertical axis). There are 366 blue dots on the graph, each dot representing a midday snapshot in 2023-24. As occupied beds increase, so do the number of wrong wards.
071
Neil Pettinger @kurtstat.bsky.social · 21/10/2025
Error in gg_point() : could not find function "gg_point". Please tell me I'm not the only person who's made this mistake! #rstats #ggplot2
ggplot(data = df_resp_midday) +
  aes(x = total_fullness,
      y = no_of_wrong_wards) +
  gg_point()
150
Neil Pettinger @kurtstat.bsky.social · 20/10/2025
I'm working on a diagram that shows how we might incorporate emotion into data visualizations. I'm trying to mash together some ideas from Gavin McMahon's new book (www.story-business.com) with Don Norman's three layers of design (www.interaction-design.org/literature/a...).
A diagram that is basically a square. The horizontal axis is labelled Reason > judgement. The vertical axis is labelled Emotion > action. Within the square, a path is suggested first up the vertical axis (by using the visceral layer of design), then across the horizontal axis (using the behavioural layer of design), and finally up to the top of the vertical axis (using the reflective layer of design). The diagram is titled "Reason leads to judgement; emotion leads to action."
010
Neil Pettinger @kurtstat.bsky.social · 20/10/2025
Most of us bring “generic” preconceptions to percentages. We think higher numbers are better. Like the anecdote about the optimist who sees a glass half-full, a pessimist who sees a glass half-empty and a hospital manager who sees a glass twice as big as it needs to be. 3/6
110
Neil Pettinger @kurtstat.bsky.social · 20/10/2025
Average percentage bed occupancy is the conventional way we measure bed usage in the NHS. (Here’s a visual example: 8,784 consecutive hour-by-hour snapshots of the number of beds occupied in a 46-bed hospital ward.) But the NHS has problems with bed occupancy as a metric. 2/6
110
Neil Pettinger @kurtstat.bsky.social · 20/10/2025
As it stands, it's a snapshot metric. I tried doing it for one specialty (Respiratory Medicine) based on hour-by-hour snapshots from two years ago. I posted it on X; can't remember if I posted it here. So here it is - in all its dual-vertical-axis glory...
010
Neil Pettinger @kurtstat.bsky.social · 16/10/2025
I still think of pivot_wider() as magic, basically.
100
Neil Pettinger @kurtstat.bsky.social · 26/09/2025
I've been using open access data to explore the relationship between Emergency Department 12-hour performance and ambulance turnaround times. Each blue dot is a week between mid-November last year and early September this year. It's a pretty close relationship for this hospital.
A scatterplot showing the relationship between the percentage of an emergency department's patients seen within 12 hours (measured along the horizontal axis) and the median ambulance turnaround time (measured in minutes up the vertical axis). The scatterplot has 43 blue dots on it, each dot representing a single week in the 43 -week period from 18 November 2024 to 8 September 2025. A clear pattern is visible. Weeks with high 12-hour compliance percentages are associated with shorter ambulance turnaround times. And weeks with low 12-hour compliance percentages are associated with longer ambulance turnaround times.
140
Neil Pettinger @kurtstat.bsky.social · 25/09/2025
Oh, I love that distinction between louder/shoutier and firmer/more drawn out! It's making me remember different types of telling-offs by my Mum as a kid! (And when you're as old as I am, underlined text is only hyperlinked if it's *blue* underlined text!)
010
Neil Pettinger @kurtstat.bsky.social · 25/09/2025
Is there a difference between upper case emphasis and bold-and-underlined emphasis?
210
Neil Pettinger @kurtstat.bsky.social · 25/09/2025
This graffiti on Restalrig Road made me remember that fantastic article by Nicholas Carr ("The Tyranny of Now") in which he wrote about Harold Innis's distinction between 'time-biased' media and 'space-biased' media! www.thenewatlantis.com/publications...
000
Neil Pettinger @kurtstat.bsky.social · 25/09/2025
You don't have to be old to be right wing, but it helps. Great graph by @owenwntr.bsky.social in @samfr.bsky.social's latest newsletter.
0235
Neil Pettinger @kurtstat.bsky.social · 06/09/2025
The top of Arthur's Seat (Edinburgh) seen from Crow Hill this morning.
040
Neil Pettinger @kurtstat.bsky.social · 03/09/2025
You can access long - and interesting - emergency care data timelines from the @publichealthscot.bsky.social website. www.publichealthscotland.scot/healthcare-s...
Two time series charts side by side. The chart on the left shows monthly attendances at NHS Scotland's Type 1  A&E departments. The chart on the right shows monthly four-hour compliance at NHS Scotland's Type 1 A&E departments. The time period is the same in both charts: July 2007 to June 2025. Attendances have been relatively stable (apart from the COVID-19 blip in 2020) at between 100,000 and 125,000 per month. By contrast, four-hour compliance has declined - first gradually (2011 to 2021), then sharply (2021 to 2023) - before stabilizing at between 60-70% in the last two years.
011
Neil Pettinger @kurtstat.bsky.social · 27/08/2025
This is how the NHS sees its patient flow problem.
020
Neil Pettinger @kurtstat.bsky.social · 26/08/2025
@chrisbrogan.bsky.social This is what happens when you try to be brutally honest with yourself in relation to the Impact Attributes...
110
Neil Pettinger @kurtstat.bsky.social · 26/08/2025
I bought this book by @chrisbrogan.bsky.social and Julien Smith ages ago. Well, I'm finally getting round to reading it. Up to page 70 already. It's very, very good.
010
Neil Pettinger @kurtstat.bsky.social · 26/08/2025
Looking over north Edinburgh towards the Firth of Forth from the top of Crow Hill (the hill next to Arthur's Seat).
130
Neil Pettinger @kurtstat.bsky.social · 26/08/2025
Thanks very much. I'm still finding my way with maps, so to speak (!), but between your advice and @drjohnrussell.com's #tidytuesday contribution, I managed to get a version of what I was after...
140
Neil Pettinger @kurtstat.bsky.social · 25/08/2025
I was inspired by @nrennie.bsky.social's datafile of the Scottish Munros, and managed to create a rough 'progress-so-far' scatterplot. But - alas! - I am new to #rstats maps and have absolutely no idea how to superimpose an outline of Scotland on this...
A scatterplot of the 282 Munros (mountains in Scotland more than 3,000 feet (914m) in height. The mountains are positioned on the 'map' according to their grid reference coordinates. Blue dots indicate Munros already climbed by Neil; red dots are the Munros still to be climbed.
242
Neil Pettinger @kurtstat.bsky.social · 18/08/2025
I took Scotland's four-hour compliance data going back to 2008 and drew a 17-year trendline. I'm trying to come up with names for The Five Stages of Four-hour Compliance. So far I've got: 1. Achievement 2. Hankering 3. Brief - very brief - remission 4. Collapse 5. Late rally #rstats #ggplot2
A line graph showing monthly measures of compliance with the four-hour target for Type 1 A&E departments in NHS Scotland. The timeline goes from the start of 2008 to June 2025. Grey rectangles have been superimposed over the line to indicate successive 'stages' in the compliance trajectory.
210
Neil Pettinger @kurtstat.bsky.social · 17/08/2025
The top of Mount Keen, the easternmost Munro.
A photo of the view from the top of Mount Keen. Trig point in the foreground.
020
Neil Pettinger @kurtstat.bsky.social · 15/08/2025
I liked this #dataviz by BBC Sport. There's a lot of information to pore over here. The only thing I'd change would be to *not* shade the period after 2017-18 so that the shading is congruent with the message in the title.
130
Neil Pettinger @kurtstat.bsky.social · 15/08/2025
I tried juxtaposition - using {patchwork} - to emphasise the difference between these two years. In 2019-20 (when the system was less dysfunctional) there was a clear relationship between AMU bed occupancy and four-hour compliance. By 2023-24 that relationship had broken down. #rstats #ggplot2
Two scatterplots side by side. The axes are identical for both charts. The horizontal axis measures Acute Medical Unit (AMU) bed occupancy from 75% to 100%. The vertical axis measures compliance with the four-hour target from 30% to 100%. The graph on the left shows the points for each of the 52 weeks in 2019-20, when overall four-hour compliance was 82% and overall AMU bed occupancy was 87%. There is a clear top-left to bottom-right slope to the 52 dots. The graph on the right shows the points for the 52 weeks of 2023-24, when four-hour compliance was 48% and AMU bed occupancy was 93%. There is far less evidence of a straight line relationship in this right-hand chart. The overall impression one gets by looking at the two charts side by side is how utterly different they were. There is no overlap at all between the areas covered by the dots.
041
Neil Pettinger @kurtstat.bsky.social · 07/08/2025
The latest delayed discharge figures for NHS Scotland were published by @publichealthscot.bsky.social on Tuesday this week. I've paired them with the latest >12-hour ED stays figures that were released on the same day. And I added a bit of grey shading to invite comments... #rstats #ggplot2
A chart that shows the monthly trend in the number of beds in NHS Scotland hospitals occupied by patients experiencing delays  and - below - the trend n the number of patients experiencing >12-hour stays in Scotland's emergency departments. The time period is from July 2016 to June 2025. Grey shaded areas indicate some of the periods when the indicators were moving in the same direction.
042
Neil Pettinger @kurtstat.bsky.social · 04/08/2025
I'm trying to create a chart that helps us understand - indirectly - what causes Emergency Department (ED) crowding. Here's a barcode graph of Acute Medical Unit (AMU) 'heaviness' (see the alt text for definition), showing how it relates to ED length of stay. #rstats #ggplot2
A chart that shows how the ‘heaviness’ of an acute medical unit (AMU) affects the length of stay of patients in the emergency department (ED). The chart shows data for one hospital during the 366 days of 2023-24 and is divided into six horizontal barcode strips. The top strip shows the days of the year when the average length of ED stay was between eight and nine hours. The next strip shows the days when the average length of ED stay was between seven and eight hours. And so on, until we get to the bottom - sixth - strip, which shows the days when the average length of ED stay was between three and four hours. The horizontal axis measures the average heaviness of the AMU for each day (calculated as that day’s average fullness multiplied by the average length of stay of the patients captured in that day’s fullness snapshots), and the general pattern shown by the chart is of a bottom-left to top-right sweep.
120
Neil Pettinger @kurtstat.bsky.social · 04/08/2025
I've decided my ED fullness barcodes look better against a coloured background. #rstats #ggplot2
A chart that shows how the fullness of an emergency department affects its performance against the four-hour target. The chart shows data for one hospital during the 366 days of 2023-24. is divided into five horizontal barcode strips. The top strip shows the (six) days of the year when four-hour compliance was between 70% and 80%, the next strip shows the (38) days when compliance was between 60% and 70%. And so on, until we get to the bottom - fifth - strip, which shows the (61) days when compliance was between 30% and 40%. The horizontal axis measures the average fullness of the ED for each day, and the general pattern shown by the chart is of a top left to bottom right sweep.
192
Neil Pettinger @kurtstat.bsky.social · 01/08/2025
Here's a chart showing the relationship between compliance with the four-hour target (vertical axis) and compliance with the twelve-hour 'target' (horizontal axis). The achievement of both has been a rare event in Scotland in the last decade: in just seven out of the 522 weeks. #rstats #ggplot2
A chart showing all of the 522 weeks from mid-July 2015 to mid-July 2025. Each week is a blue dot. The vertical axis measures compliance with the four-hour target in Scotland's Type 1 A&E departments. The horizontal axis measures compliance with the 12-hour 'target'. Only seven of the 522 dots/weeks achieved compliance with both.
011
Neil Pettinger @kurtstat.bsky.social · 26/07/2025
I drew this plot to answer a question on LinkedIn. I'm trying to show that the 'queue dynamics' of an ED's admitted patient cohort and its non-admitted patient cohort are both similar and different at the same time. But mainly I just got excited about guide = guide_axis(cap = TRUE) #rstats #ggplot2
Two scatterplots on the same chart. The x-axis measures Emergency Department (ED) crowding - the average number of patients physically in the ED each day. The vertical axis measures four-hour compliance - the percentage of each day's attendances that were treated in less than four hours. There are red dots to show the experience for admitted patients and blue dots for non-admitted patients. Both the red and the blue cohorts show negative correlations, but the slope of the red dots is steep whereas the slope of the blue dots is shallow.
062
Neil Pettinger @kurtstat.bsky.social · 15/07/2025
Patient flow: it's not always bad news. Look at the blue shaded area on the right hand side of this chart, that's a big deal. #rstats #ggplot2
A chart showing the change in the weekly number of >12-hour stays in the Emergency Department at the Royal Infirmary of Edinburgh. The horizontal axis shows all of the weeks from late February 2015 to early July 2025. The vertical axis measures the number of >12-hour stays per week. A blue shaded area at the tight-hand end of the chart indicates a sharp reduction in the number of >12-hour stays during the 18 weeks from 9 March 2025 to 6 July 2025.
372
Neil Pettinger @kurtstat.bsky.social · 14/07/2025
The counterpoint to the crowding chart that shows a difference is this attendances chart that shows no difference.
A chart showing two almost-identical bell-shaped curves. One is orange; the other is blue. The horizontal axis measures compliance with the NHS Emergency Department four-hour standard and is scaled from 0% to 100%. The vertical axis is unscaled and simply measures the number of days in 2023-24. The orange curve is centred on 48.1% compliance and represents the 183 days in the year when the ED had the most attendances per day (the average no. of ED attendances on these days was 355). The blue curve is centred on 48.9% compliance and represents the 183 days in the year when the ED had the fewest attendances per day (the average no. of ED attendances on these days was 305). The chart is titled: "The number of attendances doesn't really matter."
000
Neil Pettinger @kurtstat.bsky.social · 13/07/2025
Thanks very much for that - just the advice I needed.
020
Neil Pettinger @kurtstat.bsky.social · 12/07/2025
Overlapping curves: good enough for the BBC to show temperature change...
A BBC graphic that uses overlapping bell curves to show changes in average temperatures
000
Neil Pettinger @kurtstat.bsky.social · 12/07/2025
Now with the two geom_vline() values correctly positioned (which - embarrassingly - they weren't in the original chart!
A chart showing two overlapping bell-shaped curves. The horizontal axis measures compliance with the NHS Emergency Department four-hour standard and is scaled from 0% to 100%. The vertical axis is unscaled and simply measures the number of days in 2023-24. The orange left-hand curve is centred on 44% compliance and represents the 183 days in the year when the ED was most crowded (the average no. of patients in the ED on these days was 90). The blue right-hand curve is centred on 53% compliance and represents the 183 days in the year when the ED was least crowded (the average no. of patients in the ED on these days was 65). The chart is titled: "Ninety's a crowd; sixty-five's a slightly smaller crowd."
220
Neil Pettinger @kurtstat.bsky.social · 12/07/2025
An attempt to visualize the difference that ED crowding makes to four-hour compliance. I've 'smoothed out' the distributions (so that both curves are 'perfect' Normal curves) to try to make the point clearer. The means and standard deviations are real, though. #rstats #ggplot2
A chart showing two overlapping bell-shaped curves. The horizontal axis measures compliance with the NHS Emergency Department four-hour standard and is scaled from 0% to 100%. The vertical axis is unscaled and simply measures the number of days in 2023-24. The orange left-hand curve is centred on 44% compliance and represents the 183 days in the year when the ED was most crowded (the average no. of patients in the ED on these days was 90). The blue right-hand curve is centred on 53% compliance and represents the 183 days in the year when the ED was least crowded (the average no. of patients in the ED on these days was 65). The chart is titled: "Ninety's a crowd; sixty-five's a slightly smaller crowd."
152
Neil Pettinger @kurtstat.bsky.social · 12/07/2025
That's it? That's all you have to type? #rstats
An image with the R code: 
curve(dnorm(x, mean = 69, sd = 4), from = 53, to = 85)
followed by an image of a Normal curve, with a mean of 69 and a standard deviation of 4.
1132
Neil Pettinger @kurtstat.bsky.social · 11/07/2025
I'm sure I'm not the first person to steal this visual idea. #rstats #ggplot2 #PowerPoint (!)
A horizontal bar chart (titled 'Off the charts') showing the length of time patients spent in an Emergency Department (ED) on a day when the ED achieved 51% against the four-hour standard. The vertical axis is measured in 15-minute intervals, starting with 0-15 mins at the bottom of the chart, and ending with >240 mins at the top of the chart. The longest bar - by far - is the top bar: the patients who spent longer than four hours in the ED. This top bar is so long that it extends beyond the right hand border of the chart so that it is literally 'off the charts'.
151
Neil Pettinger @kurtstat.bsky.social · 09/07/2025
...but I've been reliably informed that - alas! - this isn't geometrically possible. I feel as if Geometry is punishing me for daring to think outside the (red) box! So I tried re-arranging it with the square - instead of the circle - as the container and I'm quite pleased with the result! 2/2
The three classic Bauhaus shapes (blue circle, yellow triangle, red square) re-arranged so that everything is contained within the red square. I quite like this.
030
Neil Pettinger @kurtstat.bsky.social · 09/07/2025
I spent too long today trying to re-arrange the Bauhaus shapes. I wanted to see if I could get the vertical side of the yellow equilateral triangle to drop through the midpoint of the red square (which it doesn't here) and still have the two left-hand edges of the square touching the triangle. 1/2
The three 'classic' Bauhaus shapes: a blue circle enclosing both a yellow triangle and a red square.
110
Neil Pettinger @kurtstat.bsky.social · 09/07/2025
It was good to see @samfr.bsky.social say today that "the main reason for lengthy A&E waiting times is the lack of hospital beds for people who need admitting, which gums up the whole system as they have to keep being treated by emergency staff." samf.substack.com/p/optimism-o... #rstats #ggplot2
Two scatterplots side by side. The chart on the left shows the relationship - or - rather - the lack thereof - between the number of A&E attendances per day and each day's four-hour compliance. The chart on the right shows the (quite strong) relationship between the level of crowding in the A&E each day and each day's four-hour compliance.
24220
Neil Pettinger @kurtstat.bsky.social · 08/07/2025
The playwright David Mamet once explained that in every scene the main character must have a need which impels them to show up. Their attempt to get this need met will result, at the end of the scene, in failure. This will then propel us into the next scene. I tried to draw a diagram of this.
000
Neil Pettinger @kurtstat.bsky.social · 02/07/2025
I love the name Marion Axminster. (What you're describing here feels close to 'Sonder', one of the words in the Dictionary of Obscure Sorrows.)
120