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
<- signals # rename the built in data set
testdf setDT(testdf)
<- testdf[grp == "WardX",head(.SD,7)]
testdf
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
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)
<- signals # rename the built in data set
testdf setDT(testdf)
<- testdf[grp == "WardX",head(.SD,13)]
testdf
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
We have extended our original baseline median, but no signals of improvement are visible yet
library(runcharter)
library(data.table)
<- signals # rename the built in data set
testdf setDT(testdf)
<- testdf[grp == "WardX",head(.SD,30)]
testdf
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
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)
<- signals # rename the built in data set
testdf setDT(testdf)
<- testdf[grp == "WardX",head(.SD,40)]
testdf
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:
<- signals # rename the built in data set
testdf ::setDT(testdf)
data.table<- testdf[grp == "WardX",head(.SD,44)]
testdf
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
<- signals # rename the built in data set
testdf ::setDT(testdf)
data.table
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