Skip to content

Instantly share code, notes, and snippets.

@stucchio
Last active August 4, 2017 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stucchio/a1feca15435ef50a26fd4153a47ab4b3 to your computer and use it in GitHub Desktop.
Save stucchio/a1feca15435ef50a26fd4153a47ab4b3 to your computer and use it in GitHub Desktop.
from scipy.stats import norm
from numpy import mean
x = norm(0,1).rvs(10000)
y = norm(1,1).rvs(10000) # Group Y is 1 standard deviation better than group X
print("Mean of group X, exceeding the cutoff: " + str(mean(x[x > 3]))) # Prints 3.22
print("Mean of group Y, exceeding the cutoff: " + str(mean(y[y > 3]))) # prints 3.40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment