Combinatorics [Bioanalytics]
❝ ❝ In a BE study involving 26 subjects […] the last 6 subjects had many points above ULOQ.
Yes, that sounds fishy, I overlooked it.
❝ Sometimes concentrations in a few subjects are higher than anticipated, but this should occur at random. Why in the last six subjects? What makes them so special? If I would be an inspector that would ring my alarm bell. I would ask R how likely the observed pattern could occur by pure chance (the code takes a good while to complete; be patient – 28 minutes on my machine):
❝
set.seed(123456)
❝ n <- 1e8 # no. of simulations; at least 1 mio needed
❝ x <- c(rep(0, 20), rep(1, 6)) # 20 "normal" subjects and 6 ">ULOQ"
❝ obs <- 0 # counter for the "last 6" pattern
❝ for(j in 1:n) { if(sum(tail(sample(x), 6)) == 6) obs <- obs + 1 }
❝ cat("p =", signif(obs/n, 4), "\n")
❝ IMHO p = 4.49·10–6 should trigger an internal investigation.
Your brain must have had too much carbon monoxide recently


Consider your resampled vector of zeros and ones - each of them have equal probability, including the one that ends with six ones in a row. So:
1. Your code will converge towards the same value as any other resampled x-vector. Means: If you had observed the need for dilution in e.g. subjects 4, 7, 13, 14, 19 and 25 (or whatever one would subjectively consider 'more random') your code would converge to the same probability.
2. That probability is
6!/(26!/(20!))
.You have 6 1's that you wish to place in your vector. The first 1 has 26 places in can go into, the second 1 has 25 it can go into, and so forth. That's how we get the denominator. In the numerator we have 6*5*4*3*2*1 ways to permute the 6 1's. They just all look the same.
Pass or fail!
ElMaestro
Complete thread:
- no of samples above ULOQ Ken Peh 2014-08-14 17:40
- no of samples above ULOQ ElMaestro 2014-08-14 19:28
- Pattern? Helmut 2014-08-15 04:16
- Pattern? Ken Peh 2014-08-17 20:31
- Not deserving an answer? Helmut 2014-08-17 21:27
- CombinatoricsElMaestro 2014-08-17 23:17
- Well done! Helmut 2014-08-17 23:43
- Pattern? ElMaestro 2014-08-18 23:54
- Few runs? Helmut 2014-08-19 03:04
- Few runs? ElMaestro 2014-08-19 23:32
- Few runs? ElMaestro 2014-08-20 00:07
- Hazelnut-sized brain Helmut 2014-08-20 11:27
- Few runs? ElMaestro 2014-08-20 00:07
- Few runs? ElMaestro 2014-08-19 23:32
- Few runs? Helmut 2014-08-19 03:04
- Pattern? Ken Peh 2014-08-17 20:31