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

posted by Helmut Homepage – Vienna, Austria, 2022-02-22 15:11 (217 d 06:26 ago) – Posting: # 22801
Views: 663

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,391 posts in 4,685 threads, 1,595 registered users;
online 2 (0 registered, 2 guests [including 1 identified bots]).
Forum time: Tuesday 22:38 CEST (Europe/Vienna)

Statistics. A sort of elementary form of mathematics which consists of
adding things together and occasionally squaring them.    Stephen Senn

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