Main Types of Incomplete Designs
In general, a study design is referred to as incomplete if not all
clusters are observed at every time period (Hemming et al. 2015). There are two main types
of incomplete designs considered in this package.
In the first type, clusters that switch early to the intervention are
not observed until the end - accordingly, observation starts later in
clusters that switch toward the end of the study (Fig. 1 ). The
“edge periods” are thus not observed (Fig. 1). The
second type excludes the transition period(s) between control and
intervention conditions (Fig. 2).
Defining Incomplete Designs in SteppedPower
An incomplete design with unobserved edge periods can be defined with
the incomplete argument. A scalar is interpreted as the
number of observed periods before and after the treatment switch in each
cluster.
An incomplete design with unobserved transition periods is best
defined with trtDelay=c(NA). This specifies one unobserved
transition period.
Further options to specify incomplete designs are:
- The input for the
incomplete argument can also be a
matrix of dimension clusters\(\cdot\)timepoints or sequences\(\cdot\)timepoints. A matrix must contain
1s for cluster cells that are observed and 0
or NAs for cluster cells that are not observed.
- Insert
NAs into an explicitly defined treatment matrix,
easiest done with the argument trtmatrix=.
glsPower() calls the function
construct_DesMat() to construct the design matrix with the
relevant arguments. All the above options can be used in the main
wrapper function, but the examples below focus on
construct_DesMat() directly.
Note SteppedPower internally stores information about
(un)observed cluster cells separately from the treatment allocation for
computational reasons.
Examples
1
If, for example, a stepped wedge study consists of eight clusters in
four sequences (i.e., five timepoints), and only the last two periods
before and the first two periods after the switch are observed, one can
use the incomplete argument
Dsn1.1 <- construct_DesMat(Cl=rep(2,4), incomplete=2)
A slightly more tedious, but more flexible way is to define a matrix
where each row corresponds to either a cluster or a wave of clusters and
each column corresponds to a timepoint. If a cluster is not observed at
a specific timepoint, set the value in the corresponding cell to
0. For the example above, such a matrix would look like
this:
TM <- toeplitz(c(1,1,0,0))
incompleteMat1 <- cbind(TM[,1:2],rep(1,4),TM[,3:4])
incompleteMat2 <- incompleteMat1[rep(1:4,each=2),]
A matrix where each row represents a wave of clusters
| 1 |
1 |
1 |
0 |
0 |
| 1 |
1 |
1 |
1 |
0 |
| 0 |
1 |
1 |
1 |
1 |
| 0 |
0 |
1 |
1 |
1 |
or each row represents a cluster
| 1 |
1 |
1 |
0 |
0 |
| 1 |
1 |
1 |
0 |
0 |
| 1 |
1 |
1 |
1 |
0 |
| 1 |
1 |
1 |
1 |
0 |
| 0 |
1 |
1 |
1 |
1 |
| 0 |
1 |
1 |
1 |
1 |
| 0 |
0 |
1 |
1 |
1 |
| 0 |
0 |
1 |
1 |
1 |
Now all that’s left to do is to plug that into the function and we
receive the same design matrix
Dsn1.2 <- construct_DesMat(Cl=rep(2,4), incomplete=incompleteMat1)
Dsn1.3 <- construct_DesMat(Cl=rep(2,4), incomplete=incompleteMat2)
all.equal(Dsn1.1$trtMat,Dsn1.2$trtMat)
## [1] TRUE
all.equal(Dsn1.1$trtMat,Dsn1.3$trtMat)
## [1] TRUE
The argument incomplete with matrix input works also for
other design types, but makes primarily most sense in the context of
stepped wedge designs
2
Now suppose we want to use a SWD to investigate the intervention
effects after at least one month,
i.e., cluster periods directly after the switch to intervention
conditions are not observed. That leads to an incomplete design that is
easiest modelled with trtDelay=
Dsn2 <- construct_DesMat(Cl=rep(2,4), trtDelay = c(NA) )
Dsn2
## Timepoints = 5
## Number of clusters per seqence = 2, 2, 2, 2
## Design type = stepped wedge
## Time adjustment = factor
## Dimension of design matrix = 40 x 6
##
## Treatment status (clusters x timepoints):
## [,1] [,2] [,3] [,4] [,5]
## [1,] 0 NA 1 1 1
## [2,] 0 NA 1 1 1
## [3,] 0 0 NA 1 1
## [4,] 0 0 NA 1 1
## [5,] 0 0 0 NA 1
## [6,] 0 0 0 NA 1
## [7,] 0 0 0 0 NA
## [8,] 0 0 0 0 NA
3
The above arguments can also be combined, e.g.
Dsn3 <- construct_DesMat(Cl=rep(2,4), incomplete=2, trtDelay=c(NA) )
## All `NA` in `trtMat` AND `0` (or `NA`) in `incomplete`, are considered to be not measured. `NA` in `trtMat` are set to `0` for computational reasons.
## Timepoints = 5
## Number of clusters per seqence = 2, 2, 2, 2
## Design type = stepped wedge
## Time adjustment = factor
## Dimension of design matrix = 40 x 6
##
## Treatment status (clusters x timepoints):
## [,1] [,2] [,3] [,4] [,5]
## [1,] 0 NA 1 NA NA
## [2,] 0 NA 1 NA NA
## [3,] 0 0 NA 1 NA
## [4,] 0 0 NA 1 NA
## [5,] NA 0 0 NA 1
## [6,] NA 0 0 NA 1
## [7,] NA NA 0 0 NA
## [8,] NA NA 0 0 NA
Hemming, Karla, Terry P Haines, Peter J Chilton, Alan J Girling, and
Richard J Lilford. 2015. “The Stepped Wedge Cluster Randomised
Trial: Rationale, Design, Analysis, and Reporting.” Bmj
350.