phase_pairs: Calculate phase-pairs for a unique case

Description Usage Arguments Examples

View source: R/preprocess-function.R

Description

Calculate phase-pairs based on phases and session numbering.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 Jan. 13, 2021, 7:10 p.m.