Monitoring Improvement

John MacKintosh

2021-11-07

Use of the package to monitor improvement

Let’s mimic the start of an improvement initiative. We have some data, but not enough to derive a meaningful baseline median:

library(runcharter)
library(data.table)
#> Warning: package 'data.table' was built under R version 4.1.1

testdf <- signals # rename the built in data set
setDT(testdf)
testdf <- testdf[grp == "WardX",head(.SD,7)]

 runcharter(testdf,
  med_rows = 0,
  runlength = 0,
  direction = "both",
  datecol = date,
 grpvar = grp,
  yval = y,
  facet_cols = 1,
  chart_breaks = ("1 month"))
#> $runchart

#> 
#> $sustained
#>      grp median start_date   end_date  extend_to run_type
#> 1: WardX     NA 2014-01-01 2014-01-01 2014-07-01 baseline

Baseline data recorded

After 13 data points have been collected, we can calculate our initial median. We’ll use this for analysis - future points will be assessed against the median and we will look for a run of 9 consecutive points below the median.

library(runcharter)
library(data.table)

testdf <- signals # rename the built in data set
setDT(testdf)
testdf <- testdf[grp == "WardX",head(.SD,13)]

 runcharter(testdf,
  med_rows = 13,
  runlength = 0,
  direction = "both",
  datecol = date,
 grpvar = grp,
  yval = y,
  facet_cols = 1,
  chart_breaks = ("1 month"))
#> $runchart

#> 
#> $sustained
#>      grp median start_date   end_date  extend_to run_type
#> 1: WardX     11 2014-01-01 2015-01-01 2015-01-01 baseline

Random variation

We have extended our original baseline median, but no signals of improvement are visible yet

library(runcharter)
library(data.table)

testdf <- signals # rename the built in data set
setDT(testdf)
testdf <- testdf[grp == "WardX",head(.SD,30)]

 runcharter(testdf,
  med_rows = 13,
  runlength = 9,
  direction = "below",
  datecol = date,
 grpvar = grp,
  yval = y,
  facet_cols = 1,
  chart_breaks = ("3 months"))
#> $runchart

#> 
#> $sustained
#>      grp median start_date   end_date  extend_to run_type
#> 1: WardX     11 2014-01-01 2015-01-01 2016-06-01 baseline

On the road to improvement

We have been working hard to deliver our improvement initiative, and we’re encouraged by a run of 5 consecutive points below the median.

library(runcharter)
library(data.table)

testdf <- signals # rename the built in data set
setDT(testdf)
testdf <- testdf[grp == "WardX",head(.SD,40)]

 runcharter(testdf,
  med_rows = 13,
  runlength = 9,
  direction = "below",
  datecol = date,
 grpvar = grp,
  yval = y,
  facet_cols = 1,
  chart_breaks = ("3 months"))
#> $runchart

#> 
#> $sustained
#>      grp median start_date   end_date  extend_to run_type
#> 1: WardX     11 2014-01-01 2015-01-01 2017-04-01 baseline

Finally, thanks to our ongoing improvement efforts, a run of 9 points on the correct side of the median line is achieved. A new median is calculated using the points from this run:

testdf <- signals # rename the built in data set
data.table::setDT(testdf)
testdf <- testdf[grp == "WardX",head(.SD,44)]

 runcharter(testdf,
  med_rows = 13,
  runlength = 9,
  direction = "below",
  datecol = date,
 grpvar = grp,
  yval = y,
  facet_cols = 1,
  chart_breaks = ("3 months"))
#> $runchart

#> 
#> $sustained
#>      grp median start_date   end_date  extend_to  run_type
#> 1: WardX     11 2014-01-01 2015-01-01 2016-12-01  baseline
#> 2: WardX      6 2016-12-01 2017-08-01 2017-08-01 sustained

Success

testdf <- signals # rename the built in data set
data.table::setDT(testdf)

 runcharter(testdf[grp == "WardX",],
  med_rows = 13,
  runlength = 9,
  direction = "below",
  datecol = date,
 grpvar = grp,
  yval = y,
  facet_cols = 1,
  chart_breaks = ("6 months"))
#> $runchart

#> 
#> $sustained
#>      grp median start_date   end_date  extend_to  run_type
#> 1: WardX     11 2014-01-01 2015-01-01 2016-12-01  baseline
#> 2: WardX      6 2016-12-01 2017-08-01 2018-07-01 sustained