Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.37 KB | None | 0 0
  1. trials <- 10000
  2. samples <- 6
  3. integerDist = 1:2
  4.  
  5. runOne <- function(ignored) {
  6.   df <- data.frame(
  7.     Algo = trunc((0:(2 * samples - 1)) / samples),
  8.     Value = sample(integerDist, 2 * samples, replace = TRUE) + runif(2 * samples, -1e-9, 1e-9)
  9.   )
  10.   anova(aov(Value ~ Algo, data=df))$'Pr(>F)'[1]
  11. }
  12.  
  13. results <- sapply(1:trials, runOne)
  14.  
  15. message(min(results) * trials)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement