Learn R Programming

SteppedPower (version 0.1.0)

construct_trtMat: 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), value(s) between 0 and 1 specifying the intervention effect in the first (second ... ) intervention phase

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

Run this code
# NOT RUN {
construct_trtMat(Cl=c(1,2,1), trtDelay=c(.2,.8), dsntype="SWD")


# }

Run the code above in your browser using DataLab