Learn R Programming

samplingDataCRT (version 1.0)

designMatrix: Design matrix for SWD model

Description

create design matrix for a given setup of a stepped wedge design

Usage

designMatrix(nC, nT, nSw, swP = NULL, design = "SWD")

Arguments

nC
number of cluster
nT
number of timepoints
nSw
number of cluster : within parallel recieve the control (nC-nSw receive the intervention), within cross-over recieve the pattern (0, 1) (nC-nSw receive the pattern (1,0)) for nearly the same number of time points, within SWD switches from control to intervention per time point
swP
is the time point the cluster cross over the condition in a cross over study, if not given then it is nearly half of the time past
design
is the study type (parallel, cross-sectional, stepped wedge)

Value

design matrix for a given setup of a stepped wedge design

Examples

Run this code

designMatrix(5,6,1)

K<-6  #measurement (or timepoints)
I<-10 #Cluster
designMatrix(nC=I, nT=K, nSw=2)

Run the code above in your browser using DataLab