phase_pairs: Calculate phase-pairs for a unique case

View source: R/preprocess-function.R

phase_pairsR Documentation

Calculate phase-pairs for a unique case

Description

Calculate phase-pairs based on phases and session numbering.

Usage

phase_pairs(phase, session = seq_along(phase))

Arguments

phase

vector of treatment indicators or a character or factor vector indicating unique treatment phases.

session

numeric vector of measurement occasions.

Examples


phases <- rep(c("A","B","A","B"), each = 4)
sessions <- 1:length(phases)

phase_pairs(phases, sessions)

phases <- rep(c("A","B","C","A","B","C","D"), each = 4)
phase_pairs(phases)

phases <- rep(c("B","A","C","B","A","B","C","A"), each = 4)
phase_pairs(phases)


scdhlm documentation built on May 29, 2024, 12:11 p.m.