Course

# T-test vs. Z-test: When to Use Each

Use t-tests when dealing with small samples or unknown variance, and Z-tests when samples are large and variance is known.

Aug 2024 · 10 min read

## Become an ML Scientist

Upskill in Python to become a machine learning scientist.

### What is the primary difference between a t-test and a Z-test?

### When should I use a one-sample t-test versus a Z-test?

### What is the role of the t-distribution in a t-test?

### Can I use a Z-test if I don't know the population variance?

### How do I determine whether to use a paired t-test or an independent two-sample t-test?

Learn with DataCamp

4 hr

74.7K

Course

### Introduction to Statistics in R

4 hr

92.4K

Track

### Statistics Fundamentals

20hrs hr

See More

RelatedSee MoreSee More

blog

### Data Demystified: What is A/B Testing?

In part seven of data demystified, we’ll break down one of the most common use cases of statistical analysis in data science: A/B testing.

Richie Cotton

10 min

tutorial

### T-tests in R Tutorial: Learn How to Conduct T-Tests

Determine if there is a significant difference between the means of the two groups using t.test() in R.

Abid Ali Awan

10 min

tutorial

### An Introduction to Python T-Tests

Learn how to perform t-tests in Python with this tutorial. Understand the different types of t-tests - one-sample test, two-sample test, paired t-test, and Welch’s test, and when to use them.

Vidhi Chugh

13 min

tutorial

### Hypothesis Testing Made Easy

Hypothesis testing is a statistical method used to evaluate claims about populations based on sample data.

Vinod Chugani

9 min

tutorial

### R Contingency Tables Tutorial

In this tutorial, you'll learn how to create contingency tables and how to test and quantify relationships visible in them.

Łukasz Deryło

10 min

code-along

### A/B Testing in R

Compare the performance of two groups with this introduction to A/B testing in R

Arne Warnke