Back to Developer Roadmap

T Test Vs Z Test

src/data/question-groups/data-science/content/t-test-vs-z-test.md

4.0582 B
Original Source

The difference between a t-test and a z-test comes down to what you know about your data: the sample size and the population standard deviation.

Use a t-test when:

  • The sample size is small (usually n ≤ 30).
  • The population standard deviation is unknown.
  • You still want to compare means (sample vs. population or between two samples).

Use a z-test when:

  • You know the population standard deviation.
  • Your sample size is large (typically n > 30).
  • The data is roughly normally distributed.