Helmut
★★★
avatar
Homepage
Vienna, Austria,
2022-06-12 11:37
(17 d 07:28 ago)

Posting: # 23051
Views: 241
 

 ‘Two-at-a-Time’ approach with >3 treat­ments [Design Issues]

Dear all,

the EMA1–3 recommends for higher-order crossovers the ‘Two-at-a-Time’ approach, i.e., to exclude all but two treatments, leading to Incomplete Block Designs.4 That’s fine, since the ‘All at Once’ approach (an ANOVA of all data) may lead to biased estimates and an inflated Type I Error.5,6

So far I had to deal only with three treatments and planned pairwise comparisons \(\small{\text{A}\;vs\;\text{C}}\) and \(\small{\text{B}\;vs\;\text{C}}\). For a six-sequence Williams’ design we get$$\small{\begin{array}{c|ccc}
s/p & \text{I} & \text{II} & \text{III} \\\hline
1 & \text{A} & \text{B} & \text{C}\\
2 & \text{A} & \text{C} & \text{B}\\
3 & \text{B} & \text{A} & \text{C}\\
4 & \text{B} & \text{C} & \text{A}\\
5 & \text{C} & \text{A} & \text{B}\\
6 & \text{C} & \text{B} & \text{A}\\
\end{array}{\color{Blue}\mapsto}
\begin{array}{c|ccc}
s/p & \text{I} & \text{II} & \text{III} \\\hline
1 & \text{A} & {\color{Red}\bullet} & \text{C}\\
2 & \text{A} & \text{C} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & \text{A} & \text{C}\\
4 & {\color{Red}\bullet} & \text{C} & \text{A}\\
5 & \text{C} & \text{A} & {\color{Red}\bullet}\\
6 & \text{C} & {\color{Red}\bullet} & \text{A}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|ccc}
s/p & \text{I} & \text{II} & \text{III} \\\hline
1 & {\color{Red}\bullet} & \text{B} & \text{C}\\
2 & {\color{Red}\bullet} & \text{C} & \text{B}\\
3 & \text{B} & {\color{Red}\bullet} & \text{C}\\
4 & \text{B} & \text{C} & {\color{Red}\bullet}\\
5 & \text{C} & {\color{Red}\bullet} & \text{B}\\
6 & \text{C} & \text{B} & {\color{Red}\bullet}\\
\end{array}}$$ where \(\small{{\color{Red}\bullet}}\) denotes an excluded treatment. Both IBDs are balanced. Excellent.

What about four treatments in a Williams’ design with pairwise comparisons \(\small{\text{A}\;vs\;\text{D}}\), \(\small{\text{B}\;vs\;\text{D}}\), and \(\small{\text{C}\;vs\;\text{D}}\)? $$\small{\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & \text{A} & \text{B} & \text{C} & \text{D}\\
2 & \text{B} & \text{D} & \text{A} & \text{C}\\
3 & \text{C} & \text{A} & \text{B} & \text{D}\\
4 & \text{D} & \text{C} & \text{B} & \text{A}\\
\end{array}{\color{Blue}\mapsto}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV} \\\hline
1 & \text{A} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{D}\\
2 & {\color{Red}\bullet} & \text{D} & \text{A} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & \text{A} & {\color{Red}\bullet} & \text{D}\\
4 & \text{D} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{A}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & {\color{Red}\bullet} & \text{B} & {\color{Red}\bullet} & \text{D}\\
2 & \text{B} & \text{D} & {\color{Red}\bullet} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{B} & \text{D}\\
4 & \text{D} & {\color{Red}\bullet} & \text{B} & {\color{Red}\bullet}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{C} & \text{D}\\
2 & {\color{Red}\bullet} & \text{D} & {\color{Red}\bullet} & \text{C}\\
3 & \text{C} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{D}\\
4 & \text{D} & \text{C} & {\color{Red}\bullet} & {\color{Red}\bullet}\\
\end{array}}$$ Now the IBDs are imbalanced and hence, lacking period effects have to be assumed. Nasty.
Solution: Use one of the 24 arrangements given by Senn.6 Here the first as an example:
$$\small{\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & \text{A} & \text{B} & \text{C} & \text{D}\\
2 & \text{B} & \text{A} & \text{D} & \text{C}\\
3 & \text{C} & \text{D} & \text{A} & \text{B}\\
4 & \text{D} & \text{C} & \text{B} & \text{A}\\
\end{array}{\color{Blue}\mapsto}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV} \\\hline
1 & \text{A} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{D}\\
2 & {\color{Red}\bullet} & \text{A} & \text{D} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & \text{D} & \text{A} & {\color{Red}\bullet}\\
4 & \text{D} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{A}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & {\color{Red}\bullet} & \text{B} & {\color{Red}\bullet} & \text{D}\\
2 & \text{B} & {\color{Red}\bullet} & \text{D} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & \text{D} & {\color{Red}\bullet} & \text{B}\\
4 & \text{D} & {\color{Red}\bullet} & \text{B} & {\color{Red}\bullet}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{C} & \text{D}\\
2 & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{D} & \text{C}\\
3 & \text{C} & \text{D} & {\color{Red}\bullet} & {\color{Red}\bullet}\\
4 & \text{D} & \text{C} & {\color{Red}\bullet} & {\color{Red}\bullet}\\
\end{array}}$$ All is good. An [image]-script at the end.
BTW, the common Latin Square (\(\small{\text{ABCD}\,|\,\text{BCDA}\,|\,\text{CDAB}\,|\,\text{DABC}}\)) would do as well.


  1. EMA, CHMP. Guideline on the Investigation of Bioequivalence. CPMP/EWP/QWP/1401/98 Rev. 1/Corr **. London. 20 January 2010. Online.
  2. Brown D. Presentation at the 3rd EGA Symposium on Bioequivalence. London. June 2010. Slides.
  3. EGA. Revised EMA Bioequivalence Guideline. Questions & Answers. Online.
  4. Cochran WG, Cox GM. Experimental Designs. New York: Wiley; 2nd ed. 1957. Chapter 9, p. 376–95.
  5. Schuirmann DJ. Two at a Time? Or All at Once? International Biometric Society, Eastern North American Region, Spring Meeting. Pittsburgh, PA. March 28–31, 2004. Abstract.
  6. D’Angelo P. Testing for Bioequivalence in Higher‐Order Crossover Designs: Two‐at‐a‐Time Principle Versus Pooled ANOVA. 2nd Conference of the Global Bioequivalence Harmonisation Initiative. Rockville, MD. 15–16 Sep­tem­ber, 2016.
  7. Senn S. Cross-over Trials in Clinical Research. Chichester: Wiley; 2nd ed. 2002. Table 5.1. p. 163.

library(PowerTOST)
library(randomizeBE)
# sample size for evaluation by ‘Two at a Time’
# note that the design has to specified as "2x2"

n    <- sampleN.TOST(CV = 0.20, theta0 = 0.95, targetpower = 0.8,
                     design = "2x2", print = FALSE)[["Sample size"]]
# specify the sequences and get the randomization list
seqs <- c("ABCD", "BADC", "CDAB", "DCBA")
rl   <- RL4(nsubj = n, seqs = seqs)$rl
rl   <- cbind(rl, IBD.1 = NA, IBD.2 = NA, IBD.3 = NA)
# extract pairwise comparisons (A vs D, B vs D, C vs D) and build the IBDs
for (j in 1:nrow(rl)) {
  rl$IBD.1[j] <- gsub("[B, C]", "•", rl$sequence[j]) # keep A and D
  rl$IBD.2[j] <- gsub("[C, A]", "•", rl$sequence[j]) # keep B and D
  rl$IBD.3[j] <- gsub("[A, B]", "•", rl$sequence[j]) # keep C and D
}
rl   <- rl[, -2] # remove seqno
# check IBDs for balance
c.1 <- c.2 <- c.3 <- NA
for (j in 1:4) {
  c.1[j] <- sum(substr(rl$IBD.1, j, j) == "A") == sum(substr(rl$IBD.1, j, j) == "D")
  c.2[j] <- sum(substr(rl$IBD.2, j, j) == "B") == sum(substr(rl$IBD.2, j, j) == "D")
  c.3[j] <- sum(substr(rl$IBD.3, j, j) == "C") == sum(substr(rl$IBD.3, j, j) == "D")
}
chk  <- setNames(c(sum(c.1), sum(c.2), sum(c.3)), c("IBD.1", "IBD.2", "IBD.3"))
txt  <- paste("Specified sequences:", paste(seqs, collapse = ", "))
if (length(unique(chk)) == 1) {
  txt <- paste(txt,
               "\nPassed check       : All IBDs are balanced.\n")
 
} else {
  txt <- paste(txt,
              "\nFailed check       : IBDs are not balanced:",
              "Examine the specified sequences.\n")
}
print(rl, row.names = FALSE)
cat(txt)


Gives
 subject sequence IBD.1 IBD.2 IBD.3
       1     DCBA  D••A  D•B•  DC••
       2     CDAB  •DA•  •D•B  CD••
       3     CDAB  •DA•  •D•B  CD••
       4     BADC  •AD•  B•D•  ••DC
       5     BADC  •AD•  B•D•  ••DC
       6     ABCD  A••D  •B•D  ••CD
       7     DCBA  D••A  D•B•  DC••
       8     ABCD  A••D  •B•D  ••CD
       9     CDAB  •DA•  •D•B  CD••
      10     BADC  •AD•  B•D•  ••DC
      11     BADC  •AD•  B•D•  ••DC
      12     ABCD  A••D  •B•D  ••CD
      13     DCBA  D••A  D•B•  DC••
      14     DCBA  D••A  D•B•  DC••
      15     CDAB  •DA•  •D•B  CD••
      16     ABCD  A••D  •B•D  ••CD
      17     DCBA  D••A  D•B•  DC••
      18     CDAB  •DA•  •D•B  CD••
      19     ABCD  A••D  •B•D  ••CD
      20     BADC  •AD•  B•D•  ••DC
Specified sequences: ABCD, BADC, CDAB, DCBA
Passed check       : All IBDs are balanced.


Dif-tor heh smusma 🖖 [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Shuanghe
★★  

Spain,
2022-06-12 19:02
(17 d 00:03 ago)

@ Helmut
Posting: # 23053
Views: 183
 

 ‘Two-at-a-Time’ approach with >3 treat­ments

Dear Helmut,

I vaguelly recall that for 4x4 William design, each row (sequence) and each column (period) should contain A, B, C, and D each exactly once. I think that there's a typo in the 3rd sequence of your first William design. Your 3rd and 4th column do not seem right. So 3rd period would have 2 Bs and 4th had 2 Ds. CABD should be CADB. So It would be ABCD/BDAC/CADB/DCBA. In such case, it would be balanced for pair-wise comparisons.

$$\small{\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & \text{A} & \text{B} & \text{C} & \text{D}\\
2 & \text{B} & \text{D} & \text{A} & \text{C}\\
3 & \text{C} & \text{A} & \text{D} & \text{B}\\
4 & \text{D} & \text{C} & \text{B} & \text{A}\\
\end{array}{\color{Blue}\mapsto}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV} \\\hline
1 & \text{A} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{D}\\
2 & {\color{Red}\bullet} & \text{D} & \text{A} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & \text{A} & \text{D} & {\color{Red}\bullet}\\
4 & \text{D} & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{A}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & {\color{Red}\bullet} & \text{B} & {\color{Red}\bullet} & \text{D}\\
2 & \text{B} & \text{D} & {\color{Red}\bullet} & {\color{Red}\bullet}\\
3 & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{D} & \text{B}\\
4 & \text{D} & {\color{Red}\bullet} & \text{B} & {\color{Red}\bullet}\\
\end{array}{\color{Blue}\wedge}
\begin{array}{c|cccc}
s/p & \text{I} & \text{II} & \text{III} & \text{IV}\\\hline
1 & {\color{Red}\bullet} & {\color{Red}\bullet} & \text{C} & \text{D}\\
2 & {\color{Red}\bullet} & \text{D} & {\color{Red}\bullet} & \text{C}\\
3 & \text{C} & {\color{Red}\bullet} & \text{D} & {\color{Red}\bullet}\\
4 & \text{D} & \text{C} & {\color{Red}\bullet} & {\color{Red}\bullet}\\
\end{array}}$$

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2022-06-12 20:10
(16 d 22:55 ago)

@ Shuanghe
Posting: # 23054
Views: 177
 

 ‘Two-at-a-Time’ approach with >3 treat­ments

Hi Shuanghe,

long time, no hear!

» I vaguelly recall that for 4x4 William design, each row (sequence) and each column (period) should contain A, B, C, and D each exactly once.

Absolutely correct.

» I think that there's a typo in the 3rd sequence of your first William design.

F**k & THX! You are right.

» Your 3rd and 4th column do not seem right. So 3rd period would have 2 Bs and 4th had 2 Ds. CABD should be CADB. So It would be ABCD/BDAC/CADB/DCBA.

Yep.

An updated [image]-script which works for any number of treatments (tested for ≤ 8) at the end. Of course, more than five treatments in a higher-order crossover are not realistic due to the number of periods and likely a Balanced In­com­plete Block Design will be used instead. Not implemented yet.

An example for the maximum of treatments I ever came across:

 subject seqno sequence  IBD.1  IBD.2  IBD.3  IBD.4  IBD.5
       1     4   DAFCEB •AF••• ••F••B ••FC•• D•F••• ••F•E•
       2     6   FDEABC F••A•• F•••B• F••••C FD•••• F•E•••
       3     6   FDEABC F••A•• F•••B• F••••C FD•••• F•E•••
       4     3   CBAEDF ••A••F •B•••F C••••F ••••DF •••E•F
       5     2   BECFAD •••FA• B••F•• ••CF•• •••F•D •E•F••
       6     5   EFBDCA •F•••A •FB••• •F••C• •F•D•• EF••••
       7     1   ACDBFE A•••F• •••BF• •C••F• ••D•F• ••••FE
       8     1   ACDBFE A•••F• •••BF• •C••F• ••D•F• ••••FE
       9     2   BECFAD •••FA• B••F•• ••CF•• •••F•D •E•F••
      10     5   EFBDCA •F•••A •FB••• •F••C• •F•D•• EF••••
      11     3   CBAEDF ••A••F •B•••F C••••F ••••DF •••E•F
      12     4   DAFCEB •AF••• ••F••B ••FC•• D•F••• ••F•E•
      13     2   BECFAD •••FA• B••F•• ••CF•• •••F•D •E•F••
      14     6   FDEABC F••A•• F•••B• F••••C FD•••• F•E•••
      15     4   DAFCEB •AF••• ••F••B ••FC•• D•F••• ••F•E•
      16     1   ACDBFE A•••F• •••BF• •C••F• ••D•F• ••••FE
      17     5   EFBDCA •F•••A •FB••• •F••C• •F•D•• EF••••
      18     4   DAFCEB •AF••• ••F••B ••FC•• D•F••• ••F•E•
      19     1   ACDBFE A•••F• •••BF• •C••F• ••D•F• ••••FE
      20     3   CBAEDF ••A••F •B•••F C••••F ••••DF •••E•F
Sequences: ACDBFE, BECFAD, CBAEDF, DAFCEB, EFBDCA, FDEABC
All extracted IBDs are balanced.

Sometimes sequences are imbalanced. In this example we have four subjects in sequences DAFCEB and FDEABC
and three subjects in each of the other four sequences. However, that’s not relevant because we aim at balance of the IBDs. If you want balance, specify bal <- TRUE. In the example it would require 24 subjects instead of 20.

Although there is just one Williams’ design for three treatments, there are six possible for four treatments, twelve for five, 120 for six, and 360 for seven. The function williams() of randomizeBE will arbitrarily select one of them.
If you run the script, the chance to get the same sequences like in my example is 1/120.


library(PowerTOST)
library(randomizeBE)
ntmt   <- 6     # number of treatments (at least 3)
CV     <- 0.20  # assumed CV
theta0 <- 0.95  # assumed T/R-ratio
target <- 0.80  # target (desired) power
bal    <- FALSE # TRUE if the study should have balanced sequences
make.equal <- function(n, nseq) {
  return(as.integer(nseq * (n %/% nseq + as.logical(n %% nseq))))
}
# sample size for evaluation by the ‘Two at a Time’ approach
# note that the design is specified as "2x2"

n      <- sampleN.TOST(CV = CV, theta0 = theta0, targetpower = target,
                       design = "2x2", print = FALSE)[["Sample size"]]
# sequences of a Williams’ design
seqs   <- williams(ntmt)
# alternatively specify your own vector:
# treatments must have only one character and the
# reference must have the highest lexical order
# a Latin Square with four treatments will work
#   seqs <- c("ABCR", "BCRA", "CRAB", "RABC")
# but this one will not
#   seqs <- c("T1T2T3R", "T2T3RT1", "T3RT1T2", "RT1T2T3")
# eventual uprounding if balance is requested

if (bal) n <- make.equal(n, length(seqs))
s      <- paste0(seqs, collapse = "")
# the last treatment in lexical order will act as the reference
s      <- paste(sort(unlist(strsplit(s, ""))), collapse = "")
ref    <- substr(s, nchar(s), nchar(s))
# extract treatment codes
trts   <- unique(c(strsplit(split = "", seqs), recursive = TRUE))
# extract tests in increasing order
tests  <- sort(trts[!trts == ref])
# get the randomization list
rand   <- suppressWarnings( # not relevant for TaT
            RL4(nsubj = n, seqs = seqs)$rl)
# generate columns for the IBDs
for (j in seq_along(tests)) {
  rand[[paste0("IBD.", j)]] <- NA
}
# build the IBDs
for (j in 1:nrow(rand)) {
  for (k in seq_along(tests)) {
    excl           <- tests[!tests == tests[k]]
    excl           <- paste0("[", paste(excl, collapse = ", "), "]")
    rand[j, 3 + k] <- gsub(excl, "•", rand$sequence[j])
  }
}
# check IBDs for balance
checks <- rep(NA, length(tests))
for (j in seq_along(tests)) {
  checks[j] <- sum(lengths(regmatches(rand[3 + j],
                                      gregexpr(tests[j],
                                               rand[3 + j])))) ==
               sum(lengths(regmatches(rand[3 + j],
                                      gregexpr(ref,
                                               rand[3 + j]))))
}
txt    <-    paste("Sequences:", paste(seqs, collapse = ", "))
if (length(unique(checks)) == 1) { # all are TRUE
  txt <- paste(txt, "\nAll extracted IBDs are balanced.\n")
 
} else {                           # at least one of the IBDs is imbalanced
  txt <- paste(txt, "\nExtracted IBDs are imbalanced;",
               "check the sequences.\n")
}
print(rand, row.names = FALSE); cat(txt)


Dif-tor heh smusma 🖖 [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
UA Flag
Activity
 Admin contact
22,181 posts in 4,647 threads, 1,572 registered users;
online 4 (0 registered, 4 guests [including 1 identified bots]).
Forum time: Wednesday 19:05 CEST (Europe/Vienna)

Nerds don’t just happen to dress informally.
They do it too consistently.
Consciously or not, they dress informally
as a prophylactic measure against stupidity.    Paul Graham

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5