Testing ‘randomness’ [General Sta­tis­tics]

posted by Helmut Homepage – Vienna, Austria, 2022-02-22 16:11 (788 d 23:25 ago) – Posting: # 22801
Views: 1,685

Hi BE-proff,

❝ Many thanks for clarification :clap:


Welcome.

runs <- 25L
n    <- 1e6
res  <- data.frame(run = 1:runs, p = NA_real_, sign = "")
for (j in 1:nrow(res)) {
  if (j == 1) set.seed(123456) else set.seed(j)
  res$p[j] <- ks.test(rnorm(n = n), "pnorm", alternative = "two.sided")$p.value
  if (res$p[j] < 0.05) res$sign[j] <- "*"
}
print(res, row.names = FALSE)


See also there for further information.

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
22,988 posts in 4,825 threads, 1,649 registered users;
25 visitors (0 registered, 25 guests [including 5 identified bots]).
Forum time: 16:37 CEST (Europe/Vienna)

As soon as we abandon our own reason, and are content
to rely upon authority, there is no end to our troubles.    Bertrand Russell

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