# What Is a Z-Test?

![Z-Test](https://www.investopedia.com/thmb/1smIr87UvLkY_MI8r6D1BwJo_mk=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/z-test.asp-final-81378e9e20704163ba30aad511c16e5d.jpg)

*Z-tests help investors assess whether differences in financial data are statistically significant or due to random chance. — Investopedia / Julie Bang*

> **Definition**
>
> A Z-test is a hypothesis test that helps an investor gauge the average daily return of a stock.

## What Is a Z-Test?

A Z-test compares one mean against a hypothesized value. It tests whether two means are the same. The data must approximately fit a [normal distribution](https://www.investopedia.com/terms/n/normaldistribution.asp), or the test won't work. Parameters such as variance and standard deviation should be calculated when performing a Z-test.

### Key Takeaways

*   A Z-test is a hypothesis test for data that follows a normal distribution. 
*   A Z-statistic, or Z-score, represents the result from the Z-test.
*   Z-tests are closely related to T-tests, but T-tests are best performed when an experiment has a small sample size.
*   Z-tests assume the standard deviation is known, while T-tests assume it is unknown.

## Hypothesis Testing

The Z-test is also a hypothesis test in which the Z-statistic follows a normal distribution. The Z-test is best used for greater-than-30 samples because, per the [central limit theorem](https://www.investopedia.com/terms/c/central_limit_theorem.asp), the samples are considered to be approximately normally distributed with larger samples. For a Z-test to be effective, the population must be normally distributed, and the samples must have the same variance. All data points should be independent of one another.

When conducting a Z-test, the null and alternative hypotheses and alpha level should be stated. The [Z-score](https://www.investopedia.com/terms/z/zscore.asp) should be calculated, and the results and conclusion represent how many standard deviations above or below the mean population a score derived from a Z-test is.

Examples of tests that can be conducted as Z-tests include a one-sample location test, a two-sample location test, a paired difference test, and a maximum likelihood estimate. Z-tests are closely related to T-tests, but T-tests are best performed when an experiment has a small sample size. Also, T-tests assume the standard deviation is unknown, while Z-tests assume it is known. If the standard deviation of the population is unknown, the assumption of the sample variance equaling the population variance is made.

### Formula for Z-Score

The Z-score is calculated with the formula:

  

> _z = ( x - μ ) / σ_

Where:

*   z = Z-score
*   x = the value being evaluated
*   μ = the mean
*   σ = the standard deviation  
    

## One-Sample Z-Test Example

Assume an investor wishes to test whether the average daily return of a stock is greater than 3%. A random sample of 50 returns is calculated with an average of 2%. Assume the standard deviation of the returns is 2.5%. Therefore, the null hypothesis is when the average, or mean, equals 3%.

Conversely, the alternative hypothesis is whether the mean return is greater or less than 3%. Assume an alpha of 0.05% is selected with a [two-tailed test](https://www.investopedia.com/terms/t/two-tailed-test.asp). There are 0.025% of the samples in each tail, and the alpha has a critical value of 1.96 or -1.96. If "Z" is greater than 1.96 or less than -1.96, the null hypothesis is rejected.

The value for Z is calculated by subtracting the value of the average daily return selected for the test, or 3% in this case, from the observed average of the samples. Next, divide the resulting value by the [standard deviation](https://www.investopedia.com/terms/s/standarddeviation.asp) divided by the square root of the number of observed values.

Therefore, the test statistic is:

> (0.02 - 0.03) ÷ (0.025 ÷ √ 50) = -2.83

The investor rejects the null hypothesis since z is less than -1.96 and concludes that the average daily return is less than 3%.  

## What's the Difference Between a T-Test and Z-Test?

T-tests are best performed when the data consists of a small sample size, i.e., less than 30. T-tests assume the standard deviation is unknown, while Z-tests assume it is known.

## When Should You Use a Z-Test?

If the standard deviation of the population is known and the sample size is greater than or equal to 30, the Z-test can be used. Regardless of the sample size, if the population standard deviation is unknown, a T-test should be used instead.

## What Is Central Limit Theorem (CLT)?

In the study of probability theory, the central limit theorem (CLT) states that the distribution of a sample approximates a normal distribution (also known as a “[bell curve](https://www.investopedia.com/terms/b/bell-curve.asp)”) as the sample size becomes larger, assuming that all samples are identical in size, and regardless of the population distribution shape. Sample sizes equal to or greater than 30 are considered sufficient for the CLT to predict the characteristics of a population accurately. The Z-test's fidelity relies on the CLT holding.

## The Bottom Line

A Z-test is used in hypothesis testing to evaluate whether a finding or association is statistically significant. In particular, it tests whether two means are the same. A Z-test can only be used if the population standard deviation is known and the sample size is 30 data points or larger. Otherwise, a T-test should be employed.

> **Article Sources**
>
> 1.  Newcastle University. "[Z-Test](https://www.ncl.ac.uk/webtemplate/ask-assets/external/maths-resources/z-test.html#:~:text=z%20%2Dtests%20are%20a%20statistical,without%20knowing%20the%20population%20variance.)."