Z and T-tests from Scratch

Kayli Leung
Nov 2 · 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.

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account? Sign in

Kayli Leung

Written by

Data Scientist

The Startup

Medium's largest active publication, followed by +542K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade