Phase sequences are built per case from time-ordered run lengths
(rle), so repeated phases such as A-B-A-B are preserved rather than
collapsed to A-B.
Arguments
- data
A data frame with case and phase columns.
Value
A character string: "ab", "reversal", "multiple_baseline",
"alternating", "changing_criterion", or "unknown".
Examples
d <- data.frame(
case = rep(c("C1", "C2"), each = 10),
phase = rep(c("A", "B"), 10),
time = rep(1:10, 2),
outcome = rnorm(20)
)
detect_design_type(d)
#> [1] "alternating"