Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (2025)

by Anupama Sapkota

Table of Contents

Z-test Definition

z-test is a statistical tool used for the comparison or determination of the significance of several statistical measures, particularly the mean in a sample from a normally distributed population or between two independent samples.

  • Like t-tests, z tests are also based on normal probability distribution.
  • Z-test is the most commonly used statistical tool in research methodology, with it being used for studies where the sample size is large (n>30).
  • In the case of the z-test, the variance is usually known.
  • Z-test is more convenient than t-test as the critical value at each significance level in the confidence interval is the sample for all sample sizes.
  • A z-score is a number indicating how many standard deviations above or below the mean of the population is.
Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (1)

Z-test formula

For the normal population with one sample:

Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (2)

where is the mean of the sample, and µ is the assumed mean, σ is the standard deviation, and n is the number of observations.

z-test for the difference in mean:

Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (3)

where 1 and 2 are the means of two samples, σ is the standard deviation of the samples, and n1 and n2 are the numbers of observations of two samples.

One sample z-test (one-tailed z-test)

  • One sample z-test is used to determine whether a particular population parameter, which is mostly mean, significantly different from an assumed value.
  • It helps to estimate the relationship between the mean of the sample and the assumed mean.
  • In this case, the standard normal distribution is used to calculate the critical value of the test.
  • If the z-value of the sample being tested falls into thecriteria for the one-sided tets, the alternative hypothesis will be accepted instead of the null hypothesis.
  • A one-tailed test would be used when the study has to test whether the population parameter being tested is either lower than or higher than some hypothesized value.
  • A one-sample z-test assumes that data are a random sample collected from a normally distributed population that all have the same mean and same variance.
  • This hypothesis implies that the data is continuous, and the distribution is symmetric.
  • Based on the alternative hypothesis set for a study, a one-sided z-test can be either a left-sided z-test or a right-sided z-test.
  • For instance, if our H0: µ0 = µ and Ha: µ < µ0, such a test would be a one-sided test or more precisely, a left-tailed test and there is one rejection area only on the left tail of the distribution.
  • However, if H0: µ = µ0 and Ha: µ > µ0, this is also a one-tailed test (right tail), and the rejection region is present on the right tail of the curve.

Two sample z-test (two-tailed z-test)

  • In the case of two sample z-test, two normally distributed independent samples are required.
  • A two-tailed z-test is performed to determine the relationship between the population parameters of the two samples.
  • In the case of the two-tailed z-test, the alternative hypothesis is accepted as long as the population parameter is not equal to the assumed value.
  • The two-tailed test is appropriate when we have H0: µ = µ0 and Ha: µ ≠ µ0 which may mean µ > µ0 or µ < µ0
  • Thus, in a two-tailed test, there are two rejection regions, one on each tail of the curve.

Z-test examples

If a sample of 400 male workers has a mean height of 67.47 inches, is it reasonable to regard the sample as a sample from a large population with a mean height of 67.39 inches and a standard deviation of 1.30 inches at a 5% level of significance?

Taking the null hypothesis that the mean height of the population is equal to 67.39 inches, we can write:

H0 : µ = 67.39

Ha: µ ≠ 67.39

= 67.47“, σ = 1.30“, n = 400

Assuming the population to be normal, we can work out the test statistic z as under:

Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (4)

Z = 1.231

Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (5)

z-test applications

  • Z-test is performed in studies where the sample size is larger, and the variance is known.
  • It is also used to determine if there is a significant difference between the mean of two independent samples.
  • The z-test can also be used to compare the population proportion to an assumed proportion or to determine the difference between the population proportion of two samples.

Z-test vs T-test (8 major differences)

Basis for comparison

T-test

Z-test

DefinitionThe t-test is a test in statistics that is used for testing hypotheses regarding the mean of a small sample taken population when the standard deviation of the population is not known.z-test is a statistical tool used for the comparison or determination of the significance of several statistical measures, particularly the mean in a sample from a normally distributed population or between two independent samples.
Sample sizeThe t-test is usually performed in samples of a smaller size (n≤30).z-test is generally performed in samples of a larger size (n>30).
Type of distribution of populationt-test is performed on samples distributed on the basis of t-distribution.z-tets is performed on samples that are normally distributed.
AssumptionsA t-test is not based on the assumption that all key points on the sample are independent.z-test is based on the assumption that all key points on the sample are independent.
Variance or standard deviationVariance or standard deviation is not known in the t-test.Variance or standard deviation is known in z-test.
DistributionThe sample values are to be recorded or calculated by the researcher.In a normal distribution, the average is considered 0 and the variance as 1.
Population parametersIn addition, to the mean, the t-test can also be used to compare partial or simple correlations among two samples.In addition, to mean, z-test can also be used to compare the population proportion.
Conveniencet-tests are less convenient as they have separate critical values for different sample sizes.z-test is more convenient as it has the same critical value for different sample sizes.

References and Sources

  • C.R. Kothari (1990) Research Methodology. Vishwa Prakasan. India.
  • https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/PASS/One-Sample_Z-Tests.pdf
  • https://www.wallstreetmojo.com/z-test-vs-t-test/
  • https://sites.google.com/site/fundamentalstatistics/chapter-13
  • 3% – https://www.investopedia.com/terms/z/z-test.asp
  • 2% – https://www.coursehero.com/file/61052903/Questions-statisticswpdf/
  • 2% – https://towardsdatascience.com/everything-you-need-to-know-about-hypothesis-testing-part-i-4de9abebbc8a
  • 2% – https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/PASS/One-Sample_Z-Tests.pdf
  • 1% – https://www.slideshare.net/MuhammadAnas96/ztest-with-examples
  • 1% – https://www.mathandstatistics.com/learn-stats/hypothesis-testing/two-tailed-z-test-hypothesis-test-by-hand
  • 1% – https://www.infrrr.com/proportions/difference-in-proportions-hypothesis-test-calculator
  • 1% – https://keydifferences.com/difference-between-t-test-and-z-test.html
  • 1% – https://en.wikipedia.org/wiki/Z-test
  • 1% – http://www.sci.utah.edu/~arpaiva/classes/UT_ece3530/hypothesis_testing.pdf
  • <1% – https://www.researchgate.net/post/Can-a-null-hypothesis-be-stated-as-a-difference
  • <1% – https://www.isixsigma.com/tools-templates/hypothesis-testing/making-sense-two-sample-t-test/
  • <1% – https://www.investopedia.com/terms/t/two-tailed-test.asp
  • <1% – https://www.academia.edu/24313503/BIOSTATISTICS_AND_RESEARCH_METHODS_IN_PHARMACY_Pharmacy_C479_4_quarter_credits_A_Course_for_Distance_Learning_Prepared

About Author

Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (6)

Anupama Sapkota

Anupama Sapkota has a bachelor’s degree (B.Sc.) in Microbiology from St. Xavier's College, Kathmandu, Nepal. She is particularly interested in studies regarding antibiotic resistance with a focus on drug discovery.

Z-Test: Formula, Examples, Uses, Z-Test vs T-Test (2025)

FAQs

How do you know if you use z-test or t-test? ›

Lesson Summary. If the population standard deviation is known, use a z-test. If the population standard deviation is unknown, but the sample size is larger than 30, use a z-test. For small samples and unknown population standard deviations, use a t-test.

What is the example formula of z-test? ›

A one-sample z test is used to check if there is a difference between the sample mean and the population mean when the population standard deviation is known. The formula for the z test statistic is given as follows: z = ¯¯¯x−μσ√n x ¯ − μ σ n .

What is the difference between t-test and z-test and F test? ›

There are several statistics available: the t-test, z-test, F-test and the chi-square test. Both the t-test and the z-test are usually used for continuous populations, and the chi-square test is used for categorical data. The F- test is used for comparing more than two means.

How does the t-test differ from the z-test quizlet? ›

A z-score is used when the population standard deviation or variance is known. The t-statistic is used when the population standard deviation or variance is unknown.

How do you know when to use z-score vs T score? ›

You must know the standard deviation of the population and your sample size should be above 30 in order for you to be able to use the z-score. Otherwise, use the t-score.

When should you use the t-test? ›

A t test is appropriate to use when you've collected a small, random sample from some statistical “population” and want to compare the mean from your sample to another value. The value for comparison could be a fixed value (e.g., 10) or the mean of a second sample.

In which scenario is a T test more appropriate than a z-test? ›

A z-test is used if the population variance is known, or if the sample size is larger than 30, for an unknown population variance. If the sample size is less than 30 and the population variance is unknown, we must use a t-test.

How do you calculate z-test by hand? ›

If x̅ is the sample mean, μ0 is the population mean, σ is the standard deviation, and n is the sample size, then the z-trial formula is expressed as follows: Z = (x̅ – μ0) / (σ /√n).

Is Z or t-test more powerful? ›

Population Standard Deviation Knowledge

The Z-test gives more reliable results when the population standard deviation is known. The T-test is ideal if you lack the population standard deviation (σ) knowledge.

When to use t-test vs F-test? ›

Conclusion. In summary, the t-test and F-test are statistical tests used in hypothesis testing to assess differences between groups or variables. The t-test is appropriate for comparing means between two groups, while the F-test is more suitable when comparing means across multiple groups or factors.

What are the assumptions for z-test and t-test? ›

The difference between the z-test and the t-test is in the assumption of the standard deviation σ of the underlying normal distribution. A z-test assumes that σ is known; a t-test does not. As a result, a t-test must compute an estimate s of the standard deviation from the sample.

How do you differentiate between z-test and t-test? ›

Key Differences between T-Test and Z-Test

Purpose: The T-test is employed to compare means of small samples (usually when the sample size is less than 30), while the Z-test is used to compare means of large samples (typically when the sample size is equal to or greater than 30).

When would you run a t-test instead of a z-test? ›

Difference between Z-test and T-test: a comparative table
T-testZ-test
6. Degrees of freedomn1 + n2 - 2Not applicable
7. Use caseSmall sample analysis, comparing means between groupsLarge sample analysis, population mean comparisons
8. One-sample vs. two-sampleBothUsually two-sample
9. Data requirementRaw dataRaw data
6 more rows

What is the difference between the way the t-test and the z-test work in this chapter? ›

A Z-test is used when we know the standard deviation of the comparison population (σ); a t-test is used when we do not have that information and must estimate the standard deviation from the sample (S).

When should you use the z-test? ›

z -tests are a statistical way of testing a hypothesis, when we know the population variance σ2 . We use them when we wish to compare the sample mean μ to the population mean μ0 . However, if your sample size is large, n≥30 n ≥ 30 , then you can still use z -tests without knowing the population variance.

In what situation would a researcher use a t-test instead of a z-test? ›

A Quick Summary: t-tests vs. Z-tests

Choosing between a t-test and a Z-test can be summarized with these guidelines: Use a t-test: When the sample size is small (n < 30) and/or the population variance is unknown. Use a Z-test: When the sample size is large (n ≥ 30) and the population variance is known.

In which cases would you prefer to use a T procedure over a Z procedure? ›

The t-test is typically used when you're working with small sample sizes or when the population standard deviation is unknown. On the other hand, the z-test is ideal for large sample sizes and known population standard deviations.

What is the difference between z-test and t-test for proportions? ›

In the case of a t-test, the population variance must be unknown. However, the population variance must be known or assumed to be known in the case of a z-test. The z-test is used when the sample size is large (n > 30) while the t-test is appropriate when the sample size is small (n < 30).

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 5869

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.