randomization: runs test [Regulatives / Guidelines]

posted by Helmut Homepage – Vienna, Austria, 2012-06-16 16:42 (5113 d 07:30 ago) – Posting: # 8756
Views: 15,179

Hi ElMaestro!

❝ I don't think I would use a runs test prior to releasing a randomisation scheme. This screws the principle of randomness; even random sequences will have a significant runs test occasionally and still be 'random' whatever that words means.


OK, but see my A1 above.

❝ ElMaestro's approach: […]



Nice; especially your remarks about NLYWs. Concerning your #3:
require(tseries)
set.seed(16062012)
size      <- 24
sims      <- 1e6
nonrandom <- 0
for (i in 1:sims) {
  x <- 1
  while (sum(x) != 0) x <- sign(rnorm(size))
  x[x ==  1] <- "RT"
  x[x == -1] <- "TR"
  x   <- as.factor(x)
  rt  <- runs.test(x)
  sig <- rt$p.value
  if (sig < 0.05) nonrandom <- nonrandom + 1
}
cat(paste("‘nonrandom’ runs: ", format(100*nonrandom/sims, digits = 4), "%\n"))


Gave 5.895% on your matey’s machine. Don’t know whether 20+ years after the deficiency letter mentioned above inspectors would still react similarly.

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

Complete thread:

UA Flag
Activity
 Admin contact
23,654 posts in 4,992 threads, 1,571 registered users;
103 visitors (0 registered, 103 guests [including 12 identified bots]).
Forum time: 00:12 CEST (Europe/Vienna)

Always listen to experts.
They’ll tell you what can’t be done and why.
Then do it.    Robert A. Heinlein

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