Z-tests are used when the population variance is known and the sample size is large, while t-tests are used when the population variance is unknown and the sample size is small.

What is Z-test?
Z-test is a statistical test used to determine whether there is a significant difference between sample and population means or between the means of two samples. It is typically used when the sample size is large (generally n > 30) and the population standard deviation is known. The Z-test is based on the standard normal distribution (Z-distribution).
The Z-test compares the means of two populations with a large sample size (typically ≥ 30) and known population standard deviation. It assesses whether the difference between the means is statistically significant.
Types of Z-Test
There are two types of Z-test i.e.,
1. One-Sample Z-Test
- Compares the sample mean to a known population mean.
- Used to determine if the sample comes from a population with a specific mean.
2. Two-Sample Z-Test
- Compares the means of two independent samples.
- Used to determine if there is a significant difference between the two sample means.
Read More about Z-Score.
What is T-test?
T-test is a statistical test used to determine whether there is a significant difference between the means of two groups.
It is particularly useful when the sample size is small (typically n < 30) and the population standard deviation is unknown. The T-test relies on the t-distribution, which is similar to the normal distribution but has heavier tails.
Types of T-Tests
There are three types of T-test i.e.,
1. One-Sample T-Test
- Compares the sample mean to a known value (usually a population mean).
- Used to determine if the sample comes from a population with a specific mean.
2. Two-Sample T-Test (Independent T-Test)
- Compares the means of two independent samples.
- Used to determine if there is a significant difference between the means of two groups.
3. Paired Sample T-Test (Dependent T-Test)
- Compares means from the same group at different times (e.g., before and after a treatment) or from matched pairs.
- Used to determine if there is a significant difference between paired observations.
Read More about T-test.
Z-Test Vs T-Test
Some of the common difference between Z-test and T-test are:
Aspect | T-Test | Z-Test |
|---|---|---|
Purpose | Compare means of small samples (n < 30) | Compare means of large samples (n ≥ 30) |
Assumptions | Normally distributed data, approximate normality | Normally distributed data, known population standard deviation |
Population Standard Deviation | Unknown | Known |
Sample Size | Small (n < 30) | Large (n ≥ 30) |
Test Statistic | T-distribution | Standard normal distribution (Z-distribution) |
Degrees of Freedom | n1 + n2 - 2 | Not applicable |
Use Case | Small sample analysis, comparing means between groups | Large sample analysis, population mean comparisons |
One-Sample vs. Two-Sample | Both | Usually two-sample |
Data Requirement | Raw data | Raw data |
Complexity | Relatively more complex | Relatively simpler |
Read More,