Join us

Hypothesis Testing Cheat-Sheet in Python

1_iN0c15Ggo2mOcScHLfBVKA.jpeg

The notebook contains 18 tests (the most popular ones, in my opinion) with their goals, assumptions, null and alternative hypotheses and examples. I wrapped those tests in functions, so their usage could be extremely easy: just input the data and get the interpretation of the test as the outcome.

Hypothesis testing can be daunting (yeah, tell me about it).

But the good thing is, it absolutely doesn’t have to be (thanks to Python and a bunch of smart people who implement packages for statistical analysis).

If you are here, the odds are you have been googling “Hypothesis Testing” for a while and are already overwhelmed with those stat buzzwords (you know what buzzwords I mean, right? the z-test vs t-tests, paired vs unpaired tests, one-tail vs two-tail tests, one-way vs two-way tests, etc.).

So, I created a simple cheat-sheet that might come handy to you as well. Here is the link.

The notebook contains 18 tests (the most popular ones, in my opinion) with their goals, assumptions, null and alternative hypotheses and examples. I wrapped those tests in functions, so their usage could be extremely easy: just input the data and get the interpretation of the test as the outcome.

Notebook Outline ->

Normality tests

  • Kolmogorov-Smirnov test
  • Shapiro-Wilk Test
  • D’Agostino’s KÂČ Test

For comparing means

  • 1-sample z-test for mean
  • 2-sample z-test for mean
  • 1-sample t-test for mean
  • 2-sample independent t-test for mean (Student’s test)
  • paired t-test for mean (Student’s test)
  • one-way ANNOVA
  • two-way ANNOVA

For comparing proportions

  • 1-sample z-test for proportion
  • 1-sample t-test for proportion
  • 2-sample t-test for proportion
  • Chi-square test for independence (Pearson’s chi-square)
  • Fisher’s exact test

For finding relationship

  • Pearson’s correlation test

For comparing medians

  • Wilcoxon Rank test

In some tests, I also calculated the test-statistics without relying on imported packages, so that we can see there’s no magic happening under the hood.

P.S. I created this notebook for my daily needs, so it doesn’t have educational purposes. If you have any comments, suggestions, or if you happen to find any bugs there, let me know :)


Only registered users can post comments. Please, login or signup.

Start blogging about your favorite technologies, reach more readers and earn rewards!

Join other developers and claim your FAUN account now!

User Popularity
16

Influence

959

Total Hits

1

Posts