construct_trtMat: Construct Treatment Matrix

View source: R/construct_DesMat.R

construct_trtMatR Documentation

Construct Treatment Matrix

Description

Constructs a matrix of ⁠#cluster⁠ rows and ⁠#timepoint⁠ columns, indicating treatment status in each cluster at each timepoint.

Usage

construct_trtMat(Cl, trtDelay, dsntype, timepoints = NULL)

Arguments

Cl

integer (vector), number of clusters per sequence group (in SWD), or number in control and intervention (in parallel designs)

trtDelay

numeric (possibly vector), NA(s) and/or value(s) between 0 and 1. NA means that first (second, ... ) period after intervention start is not observed. A value between 0 and 1 specifies the assumed proportion of intervention effect in the first (second ... ) intervention period.

dsntype

character, defines the type of design. Options are "SWD", "parallel" and "parallel_baseline", defaults to "SWD".

timepoints

numeric (scalar or vector), number of timepoints (periods). If design is swd, timepoints defaults to length(Cl)+1. Defaults to 1 for parallel designs.

Value

a matrix trtMat, where rows and columns correspond to cluster and timepoints, respectively

Examples

construct_trtMat(Cl=c(1,2,1), trtDelay=c(.2,.8), dsntype="SWD")



PMildenb/SteppedPower documentation built on Nov. 24, 2024, 3:06 a.m.