daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set.seed(4)
  2. x = matrix(rnorm(100*5),nrow=100)
  3. set.seed(5)
  4. y = matrix(rnorm(100*5),nrow=100)
  5. set.seed(6)
  6. y[81:100,]= rnorm(100, mean=3)
  7.    
  8. p = sapply(1:100, function(i) t.test(x[i,],y[i,])$p.val)
  9. sort.p<-sort(p)
  10.    
  11. eq<-function(){(q*(1:n))/n}
  12.  
  13. rej.pvals <- sort.p[sort.p<=eq()]     #Find all the p-values which are smaller than q*i/n
  14.    
  15. > sum(match(rej.p,p)<=80)
  16. [1] 4
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top