What Is a Z-Test?
Let me explain what a Z-test is: it's a hypothesis test that helps you gauge the average daily return of a stock, for instance. Essentially, a Z-test compares one mean against a hypothesized value or tests whether two means are the same. For it to work properly, your data must approximately fit a normal distribution; otherwise, the test won't be reliable. When you're performing a Z-test, you need to calculate parameters like variance and standard deviation.
Key Takeaways
Here's what you need to know: a Z-test is a hypothesis test for data that follows a normal distribution. The result comes as a Z-statistic or Z-score. Z-tests are closely related to T-tests, but you should use T-tests when your experiment has a small sample size. Remember, Z-tests assume the standard deviation is known, while T-tests assume it's unknown.
Hypothesis Testing
The Z-test falls under hypothesis testing, where the Z-statistic follows a normal distribution. You should use the Z-test for samples greater than 30 because, according to the central limit theorem, larger samples are approximately normally distributed. For the Z-test to be effective, the population must be normally distributed, and samples must have the same variance. All data points need to be independent.
When you conduct a Z-test, state the null and alternative hypotheses along with the alpha level. Calculate the Z-score, and the results will show how many standard deviations above or below the population mean your score is.
You can conduct various tests as Z-tests, such as a one-sample location test, a two-sample location test, a paired difference test, and a maximum likelihood estimate. Again, Z-tests are similar to T-tests, but T-tests are better for small samples. T-tests assume unknown standard deviation, while Z-tests assume it's known. If the population standard deviation is unknown, we assume the sample variance equals the population variance.
Formula for Z-Score
The Z-score is calculated using this formula: z = (x - μ) / σ, where z is the Z-score, x is the value being evaluated, μ is the mean, and σ is the standard deviation.
One-Sample Z-Test Example
Suppose you, as an investor, want to test if the average daily return of a stock is greater than 3%. You take a random sample of 50 returns, and the average is 2%. Assume the standard deviation of the returns is 2.5%. So, the null hypothesis is that the mean equals 3%.
The alternative hypothesis is that the mean is greater or less than 3%. Let's assume an alpha of 0.05% with a two-tailed test. That means 0.025% in each tail, and the critical values are 1.96 or -1.96. If Z is greater than 1.96 or less than -1.96, reject the null hypothesis.
To calculate Z, subtract the hypothesized average (3%) from the observed average (2%), then divide by the standard deviation divided by the square root of the sample size. So, the test statistic is (0.02 - 0.03) ÷ (0.025 ÷ √50) = -2.83.
Since -2.83 is less than -1.96, you reject the null hypothesis and conclude the average daily return is less than 3%.
What's the Difference Between a T-Test and Z-Test?
T-tests are best when your data has a small sample size, like less than 30. They assume the standard deviation is unknown, whereas Z-tests assume it's known.
When Should You Use a Z-Test?
Use a Z-test if the population standard deviation is known and the sample size is 30 or larger. If the population standard deviation is unknown, regardless of sample size, go with a T-test instead.
What Is Central Limit Theorem (CLT)?
In probability theory, the central limit theorem (CLT) states that the distribution of a sample approximates a normal distribution as the sample size gets larger, assuming samples are identical in size, no matter the population's distribution shape. Samples of 30 or more are usually sufficient for the CLT to hold, which is why Z-tests rely on it for accuracy.
The Bottom Line
A Z-test is used in hypothesis testing to check if a finding is statistically significant, especially to see if two means are the same. You can only use it if the population standard deviation is known and the sample size is 30 or larger; otherwise, employ a T-test.
Other articles for you

This text explains what stock price targets are, how analysts calculate them, and their role in investment decisions.

An open-end management company manages open-end funds like mutual funds and ETFs, allowing continuous issuance and redemption of shares based on investor demand.

A relative valuation model compares a company's value to similar firms using financial metrics to determine if it's overvalued or undervalued.

Negative convexity occurs when a bond's price decreases as interest rates fall, leading to a concave yield curve, commonly seen in callable and mortgage bonds.

A roll back is an options trading strategy where you replace an existing position with one having a nearer expiration date to manage risk and volatility.

A managed account is an investment portfolio owned by an investor but overseen by a hired professional manager who makes decisions based on the client's needs.

The World Equity Benchmark Series (WEBS) was an international fund renamed to iShares MSCI Emerging Markets ETF in 2000, tracking emerging market equities and offering diversification similar to other ETFs like SPDR S&P 500 Trust.

Harry Markowitz pioneered Modern Portfolio Theory, revolutionizing investment by emphasizing portfolio diversification over individual stock performance.

An earnings estimate is an analyst's prediction of a company's future earnings per share, crucial for valuing stocks and influencing investment decisions.

This text is a comprehensive listing of articles on behavioral economics from Investopedia, exploring how psychological factors influence economic decisions.