Advertisement
Guest User

Untitled

a guest
May 6th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. lapply(1:10000, function(B){
  2. set.seed(B)
  3. x <- runif(15, min = 0, max = 1)
  4. a <- ks.test(x, 'punif')
  5. b <- ks.test(x, 'punif', min = min(x), max = max(x))
  6. c(true = a$p.value, est= b$p.value)
  7. }) -> boot
  8.  
  9. library(ggplot2)
  10. dfs <- do.call(rbind, boot) %>% as.data.frame
  11. dd <- melt(dfs)
  12.  
  13. ggplot() + geom_density(aes(x = value, colour = variable, group = variable), dd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement