1  Introduction

Note

You will need a basic degree of familiarity with the R language. Appendix A gives a brief introduction.

Single case research has become an important and widely accepted method for gaining insight into educational processes. In particular, the field of special education has embraced single case research as an appropriate method for evaluating the effectiveness of an intervention or the developmental processes underlying problems in the acquisition of academic skills. Single case studies are also popular with teachers and educators who are interested in evaluating the learning progress of their students. Despite their usefulness, standards for conducting single-case studies, analysing the data, and presenting the results are less well developed than for group-based research designs. Furthermore, while there is a wealth of software available to help analyse data, most of it is designed to analyse group-based datasets. Visualising single case data sets often means fiddling with spreadsheets, and analysis becomes a cumbersome endeavour. This book fills that gap. It has been written around a specialised software tool for managing, visualising and analysing single case data. This tool is an extension package for the R software (R Core Team, 2024) called scan, an acronym for single case analysis.

1.1 A teaser

Before going into the details of how scan works, I would like to give you an example of what you can do with scan. It is meant as a teaser to get you motivated to tackle the steep learning curve associated with using R (but there is a land of milk and honey behind that curve!). So, do not worry if you do not understand every detail of this example, it will all be explained and obvious to you once you become familiar with scan.

Let us set a fictional context. Suppose you are researching a method to improve the arithmetic skills of struggling fourth-grade students. You have developed an intervention programme called KUNO. In a pilot study, you want to get some evidence about the effectiveness of this new method, and you set up a multi-baseline single-case study with three students who participated in the KUNO programme over a period of ten weeks. during the course, you regularly measured each student’s numeracy skills 20 times using a reliable test. You also carried out a follow-up after eight weeks with five additional measures. I am now going to make up some data for this fictitious KUNO study, because it would be too difficult to carry out a real study and actually develop a real intervention method.

We use the scan package to code the data. Each case has 25 measurements. We have three phases: before the intervention (A), during the intervention (B), and a follow-up (C). Phases A and B are of different lengths. The cases are named and combined into a single object called strange_study.

library(scan)
library(scplot)

case1 <- scdf(
  c(A = 3, 2, 4, 6, 4, 3, 
    B = 6, 5, 4, 6, 7, 5, 6, 8, 6, 7, 8, 9, 7, 8, 
    C = 6, 6, 8, 5, 7), 
  name = "Dustin"
)
case2 <- scdf(
  c(A = 0, 1, 3, 1, 4, 2, 1, 
    B = 2, 1, 4, 3, 5, 5, 7, 6, 3, 8, 6, 4, 7, 
    C = 6, 5, 6, 8, 6), 
  name = "Mike"
)
case3 <- scdf(
  c(A = 7, 5, 6, 4, 4, 7, 5, 7, 4,
    B = 8, 9, 11, 13, 12, 15, 16, 13, 17, 16, 18,
    C = 17, 20, 22, 18, 20), 
  name = "Will"
)
strange_study <- c(case1, case2, case3)

Now we visualize the cases:

scplot(strange_study) %>%
  set_ylabel("Correct") %>%
  set_xlabel ("Days") %>%
  add_statline("lowess", color = "red") %>%
  set_phasenames(c("Baseline", "Intervention", "Follow-up")) %>%
  set_yaxis(limits = c(0, 30)) %>%
  set_xaxis(increment = 2) %>%
  add_ridge(color = "lightblue") %>%
  set_theme("basic")

Now we need some descriptive statistics:

describe(strange_study)
Descriptive statistics
Parameter Dustin Mike Will
Design A-B-C A-B-C A-B-C
n A 6 7 9
n B 14 13 11
n C 5 5 5
Missing A 0 0 0
Missing B 0 0 0
Missing C 0 0 0
m A 3.67 1.71 5.44
m B 6.57 4.69 13.45
m C 6.4 6.2 19.4
md A 3.5 1.0 5.0
md B 6.5 5.0 13.0
md C 6 6 20
sd A 1.37 1.38 1.33
sd B 1.40 2.10 3.27
sd C 1.14 1.10 1.95
mad A 0.74 1.48 1.48
mad B 1.48 2.97 4.45
mad C 1.48 0.00 2.97
Min A 2 0 4
Min B 4 1 8
Min C 5 5 17
Max A 6 4 7
Max B 9 8 18
Max C 8 8 22
Trend A 0.23 0.21 -0.08
Trend B 0.25 0.36 0.91
Trend C 0.1 0.3 0.4
Note. n = Number of measurements; Missing = Number of missing values; M = Mean; Median = Median; SD = Standard deviation; MAD = Median average deviation; Min = Minimum; Max = Maximum; Trend = Slope of dependent variable regressed on measurement-time.

Single-case data are often analysed using overlap indices. Let us get an overview by comparing phases A and B:

overlap(strange_study)
Overlap indices. Comparing phase 1 against phase 2
Statistic Dustin Mike Will
PND 50.00 53.85 100.00
PEM 100.00 92.31 100.00
PET 71.43 61.54 100.00
NAP 92.86 87.91 100.00
NAP-R 85.71 75.82 100.00
PAND 90.00 80.00 100.00
IRD 0.76 0.56 1.00
Tau-U (A + B - trend A) 0.53 0.45 0.67
Tau-U (A + B - trend A + trend B) 0.66 0.56 0.80
Base Tau 0.60 0.55 0.74
Delta M 2.90 2.98 8.01
Delta Trend 0.02 0.14 0.99
SMD 2.13 2.16 6.01
Hedges g 2.00 1.51 2.96
Note. PND = Percentage Non-Overlapping Data; PEM = Percentage Exceeding the Median; PET = Percentage Exceeding the Trend; NAP = Nonoverlap of all pairs; NAP-R = NAP rescaled; PAND = Percentage all nonoverlapping data; IRD = Improvement rate difference; Tau U (A + B - trend A) = Parker’s Tau-U; Tau U (A + B - trend A + trend B) = Parker’s Tau-U; Base Tau = Baseline corrected Tau; Delta M = Mean difference between phases; Delta Trend = Trend difference between phases; SMD = Standardized Mean Difference; Hedges g = Corrected SMD.

How do the changes hold up against the follow-up? Let us compare phases A and C:

overlap(strange_study, phases = c("A", "C"))
Overlap indices. Comparing phase A against phase C
Statistic Dustin Mike Will
PND 40.00 100.00 100.00
PEM 100.00 100.00 100.00
PET 0.00 60.00 100.00
NAP 93.33 100.00 100.00
NAP-R 86.67 100.00 100.00
PAND 81.82 100.00 100.00
IRD 0.82 1.00 1.00
Tau-U (A + B - trend A) 0.48 0.50 0.61
Tau-U (A + B - trend A + trend B) 0.46 0.51 0.61
Base Tau 0.67 0.76 0.74
Delta M 2.73 4.49 13.96
Delta Trend −0.13 0.09 0.48
SMD 2.00 3.25 10.47
Hedges g 1.97 3.25 8.34
Note. PND = Percentage Non-Overlapping Data; PEM = Percentage Exceeding the Median; PET = Percentage Exceeding the Trend; NAP = Nonoverlap of all pairs; NAP-R = NAP rescaled; PAND = Percentage all nonoverlapping data; IRD = Improvement rate difference; Tau U (A + B - trend A) = Parker’s Tau-U; Tau U (A + B - trend A + trend B) = Parker’s Tau-U; Base Tau = Baseline corrected Tau; Delta M = Mean difference between phases; Delta Trend = Trend difference between phases; SMD = Standardized Mean Difference; Hedges g = Corrected SMD.

Finally, we conduct regression analyses for each cases with a piecewise regression model:

plm(strange_study$Dustin)
plm(strange_study$Mike)
plm(strange_study$Will)
Piecewise-regression model predicting variable ‘values’
Parameter B CI(95%) SE t p delta R²
2.5% 97.5%
Intercept 3.095 1.463 4.728 0.833 3.716 <.01
Trend mt 0.229 -0.311 0.768 0.275 0.831 .41 0.012
Level phase B 0.505 -1.886 2.896 1.220 0.414 .68 0.003
Level phase C -1.467 -11.107 8.173 4.919 -0.298 .76 0.002
Slope phase B 0.018 -0.542 0.577 0.285 0.062 .95 0.000
Slope phase C -0.129 -1.023 0.766 0.456 -0.282 .78 0.001
Note. F(5, 19) = 7.88; p <.001; R² = 0.675; Adjusted R² = 0.589.
Piecewise-regression model predicting variable ‘values’
Parameter B CI(95%) SE t p delta R²
2.5% 97.5%
Intercept 1.071 -0.952 3.094 1.032 1.038 .31
Trend mt 0.214 -0.347 0.775 0.286 0.749 .46 0.009
Level phase B -0.022 -2.975 2.931 1.506 -0.015 .98 0.000
Level phase C 0.243 -9.633 10.118 5.039 0.048 .96 0.000
Slope phase B 0.143 -0.460 0.746 0.308 0.465 .64 0.004
Slope phase C 0.086 -1.008 1.179 0.558 0.154 .88 0.000
Note. F(5, 19) = 8.00; p <.001; R² = 0.678; Adjusted R² = 0.593.
Piecewise-regression model predicting variable ‘values’
Parameter B CI(95%) SE t p delta R²
2.5% 97.5%
Intercept 5.778 3.961 7.595 0.927 6.232 <.001
Trend mt -0.083 -0.465 0.298 0.195 -0.428 .67 0.001
Level phase B 3.881 1.162 6.600 1.387 2.798 <.05 0.022
Level phase C 14.489 7.893 21.084 3.365 4.306 <.001 0.052
Slope phase B 0.992 0.518 1.467 0.242 4.100 <.01 0.047
Slope phase C 0.483 -0.526 1.493 0.515 0.938 .36 0.002
Note. F(5, 19) = 68.16; p <.001; R² = 0.947; Adjusted R² = 0.933.