Skip to content

Instantly share code, notes, and snippets.

@shandou
Last active May 30, 2018 05:25
Show Gist options
  • Save shandou/84909e8093c461112e75b4c72de10d23 to your computer and use it in GitHub Desktop.
Save shandou/84909e8093c461112e75b4c72de10d23 to your computer and use it in GitHub Desktop.
hypothesis test for population Pearson's r
import scipy.stats
n = 25 # Number of samples n
df = n - 2 # Degrees of freedom
alpha = 0.05 # Significant level
# Non-direction tests for computing t-critical value
t_critical = scipy.stats.t.ppf(1 - alpha / 2, df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment