Advertisement
smathot

multiplied p-values

Mar 27th, 2013
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from random import random
  2. import numpy as np
  3. N = 100000
  4. # alpha = .009 # This leads to a mean of about .05
  5. alpha = .1 # This leads to a mean of about .33
  6. a = np.zeros(N)
  7. for i in range(N):
  8.     p1 = random() # Get one p-value
  9.     p2 = random() # Get another p-value
  10.     p3 = p1 * p2 # Get the multiplied p-value
  11.     if p3 < alpha: # Determine if the multiplied p-value is below alpa
  12.         a[i] = 1
  13. print a.mean()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement