Z and T-tests from Scratch

Kayli Leung
Nov 2, 2019 · 4 min read

The Z and T-tests are both used for hypothesis testing. Using a quick block of code, it is easy to generate results from these tests, but what is going on behind the scenes. In this blog, I will discuss the math and assumptions behind each of these test, I will also assume you understand the basics of running a hypothesis test to focus on the math.

One-Sample Z-Test

A Z test is used when we want to measure if a sample comes from a specified population. In other words, does is the sample different than what we expect from a given population.