 Skip to secondary menu
 Skip to main content
 Skip to primary sidebar
Statistics By Jim
Making statistics intuitive
Z Test: Uses, Formula & Examples
By Jim Frost Leave a Comment
What is a Z Test?
Use a Z test when you need to compare group means. Use the 1sample analysis to determine whether a population mean is different from a hypothesized value. Or use the 2sample version to determine whether two population means differ.
A Z test is a form of inferential statistics . It uses samples to draw conclusions about populations.
For example, use Z tests to assess the following:
 One sample : Do students in an honors program have an average IQ score different than a hypothesized value of 100?
 Two sample : Do two IQ boosting programs have different mean scores?
In this post, learn about when to use a Z test vs T test. Then we’ll review the Z test’s hypotheses, assumptions, interpretation, and formula. Finally, we’ll use the formula in a worked example.
Related post : Difference between Descriptive and Inferential Statistics
Z test vs T test
Z tests and t tests are similar. They both assess the means of one or two groups, have similar assumptions, and allow you to draw the same conclusions about population means.
However, there is one critical difference.
Z tests require you to know the population standard deviation, while t tests use a sample estimate of the standard deviation. Learn more about Population Parameters vs. Sample Statistics .
In practice, analysts rarely use Z tests because it’s rare that they’ll know the population standard deviation. It’s even rarer that they’ll know it and yet need to assess an unknown population mean!
A Z test is often the first hypothesis test students learn because its results are easier to calculate by hand and it builds on the standard normal distribution that they probably already understand. Additionally, students don’t need to know about the degrees of freedom .
Z and T test results converge as the sample size approaches infinity. Indeed, for sample sizes greater than 30, the differences between the two analyses become small.
William Sealy Gosset developed the t test specifically to account for the additional uncertainty associated with smaller samples. Conversely, Z tests are too sensitive to mean differences in smaller samples and can produce statistically significant results incorrectly (i.e., false positives).
When to use a T Test vs Z Test
Let’s put a button on it.
When you know the population standard deviation, use a Z test.
When you have a sample estimate of the standard deviation, which will be the vast majority of the time, the best statistical practice is to use a t test regardless of the sample size.
However, the difference between the two analyses becomes trivial when the sample size exceeds 30.
Learn more about a TTest Overview: How to Use & Examples and How TTests Work .
Z Test Hypotheses
This analysis uses sample data to evaluate hypotheses that refer to population means (µ). The hypotheses depend on whether you’re assessing one or two samples.
OneSample Z Test Hypotheses
 Null hypothesis (H 0 ): The population mean equals a hypothesized value (µ = µ 0 ).
 Alternative hypothesis (H A ): The population mean DOES NOT equal a hypothesized value (µ ≠ µ 0 ).
When the pvalue is less or equal to your significance level (e.g., 0.05), reject the null hypothesis. The difference between your sample mean and the hypothesized value is statistically significant. Your sample data support the notion that the population mean does not equal the hypothesized value.
Related posts : Null Hypothesis: Definition, Rejecting & Examples and Understanding Significance Levels
TwoSample Z Test Hypotheses
 Null hypothesis (H 0 ): Two population means are equal (µ 1 = µ 2 ).
 Alternative hypothesis (H A ): Two population means are not equal (µ 1 ≠ µ 2 ).
Again, when the pvalue is less than or equal to your significance level, reject the null hypothesis. The difference between the two means is statistically significant. Your sample data support the idea that the two population means are different.
These hypotheses are for twosided analyses. You can use onesided, directional hypotheses instead. Learn more in my post, OneTailed and TwoTailed Hypothesis Tests Explained .
Related posts : How to Interpret P Values and Statistical Significance
Z Test Assumptions
For reliable results, your data should satisfy the following assumptions:
You have a random sample
Drawing a random sample from your target population helps ensure that the sample represents the population. Representative samples are crucial for accurately inferring population properties. The Z test results won’t be valid if your data do not reflect the population.
Related posts : Random Sampling and Representative Samples
Continuous data
Z tests require continuous data . Continuous variables can assume any numeric value, and the scale can be divided meaningfully into smaller increments, such as fractional and decimal values. For example, weight, height, and temperature are continuous.
Other analyses can assess additional data types. For more information, read Comparing Hypothesis Tests for Continuous, Binary, and Count Data .
Your sample data follow a normal distribution, or you have a large sample size
All Z tests assume your data follow a normal distribution . However, due to the central limit theorem, you can ignore this assumption when your sample is large enough.
The following sample size guidelines indicate when normality becomes less of a concern:
 OneSample : 20 or more observations.
 TwoSample : At least 15 in each group.
Related posts : Central Limit Theorem and Skewed Distributions
Independent samples
For the twosample analysis, the groups must contain different sets of items. This analysis compares two distinct samples.
Related post : Independent and Dependent Samples
Population standard deviation is known
As I mention in the Z test vs T test section, use a Z test when you know the population standard deviation. However, when n > 30, the difference between the analyses becomes trivial.
Related post : Standard Deviations
Z Test Formula
These Z test formulas allow you to calculate the test statistic. Use the Z statistic to determine statistical significance by comparing it to the appropriate critical values and use it to find pvalues.
The correct formula depends on whether you’re performing a one or twosample analysis. Both formulas require sample means (x̅) and sample sizes (n) from your sample. Additionally, you specify the population standard deviation (σ) or variance (σ 2 ), which does not come from your sample.
I present a worked example using the Z test formula at the end of this post.
Learn more about ZScores and Test Statistics .
One Sample Z Test Formula
The one sample Z test formula is a ratio.
The numerator is the difference between your sample mean and a hypothesized value for the population mean (µ 0 ). This value is often a strawman argument that you hope to disprove.
The denominator is the standard error of the mean. It represents the uncertainty in how well the sample mean estimates the population mean.
Learn more about the Standard Error of the Mean .
Two Sample Z Test Formula
The two sample Z test formula is also a ratio.
The numerator is the difference between your two sample means.
The denominator calculates the pooled standard error of the mean by combining both samples. In this Z test formula, enter the population variances (σ 2 ) for each sample.
Z Test Critical Values
As I mentioned in the Z vs T test section, a Z test does not use degrees of freedom. It evaluates Zscores in the context of the standard normal distribution. Unlike the tdistribution , the standard normal distribution doesn’t change shape as the sample size changes. Consequently, the critical values don’t change with the sample size.
To find the critical value for a Z test, you need to know the significance level and whether it is one or twotailed.
0.01  TwoTailed  ±2.576 
0.01  Left Tail  –2.326 
0.01  Right Tail  +2.326 
0.05  TwoTailed  ±1.960 
0.05  Left Tail  +1.650 
0.05  Right Tail  –1.650 
Learn more about Critical Values: Definition, Finding & Calculator .
Z Test Worked Example
Let’s close this post by calculating the results for a Z test by hand!
Suppose we randomly sampled subjects from an honors program. We want to determine whether their mean IQ score differs from the general population. The general population’s IQ scores are defined as having a mean of 100 and a standard deviation of 15.
We’ll determine whether the difference between our sample mean and the hypothesized population mean of 100 is statistically significant.
Specifically, we’ll use a twotailed analysis with a significance level of 0.05. Looking at the table above, you’ll see that this Z test has critical values of ± 1.960. Our results are statistically significant if our Z statistic is below –1.960 or above +1.960.
The hypotheses are the following:
 Null (H 0 ): µ = 100
 Alternative (H A ): µ ≠ 100
Entering Our Results into the Formula
Here are the values from our study that we need to enter into the Z test formula:
 IQ score sample mean (x̅): 107
 Sample size (n): 25
 Hypothesized population mean (µ 0 ): 100
 Population standard deviation (σ): 15
The Zscore is 2.333. This value is greater than the critical value of 1.960, making the results statistically significant. Below is a graphical representation of our Z test results showing how the Z statistic falls within the critical region.
We can reject the null and conclude that the mean IQ score for the population of honors students does not equal 100. Based on the sample mean of 107, we know their mean IQ score is higher.
Now let’s find the pvalue. We could use technology to do that, such as an online calculator. However, let’s go old school and use a Z table.
To find the pvalue that corresponds to a Zscore from a twotailed analysis, we need to find the negative value of our Zscore (even when it’s positive) and double it.
In the truncated Ztable below, I highlight the cell corresponding to a Zscore of 2.33.
The cell value of 0.00990 represents the area or probability to the left of the Zscore 2.33. We need to double it to include the area > +2.33 to obtain the pvalue for a twotailed analysis.
Pvalue = 0.00990 * 2 = 0.0198
That pvalue is an approximation because it uses a Zscore of 2.33 rather than 2.333. Using an online calculator, the pvalue for our Z test is a more precise 0.0196. This pvalue is less than our significance level of 0.05, which reconfirms the statistically significant results.
See my full Ztable , which explains how to use it to solve other types of problems.
Share this:
Reader Interactions
Comments and questions cancel reply.
Ztest Calculator
Table of contents
This Ztest calculator is a tool that helps you perform a onesample Ztest on the population's mean . Two forms of this test  a twotailed Ztest and a onetailed Ztests  exist, and can be used depending on your needs. You can also choose whether the calculator should determine the pvalue from Ztest or you'd rather use the critical value approach!
Read on to learn more about Ztest in statistics, and, in particular, when to use Ztests, what is the Ztest formula, and whether to use Ztest vs. ttest. As a bonus, we give some stepbystep examples of how to perform Ztests!
Or you may also check our tstatistic calculator , where you can learn the concept of another essential statistic. If you are also interested in Ftest, check our Fstatistic calculator .
What is a Ztest?
A one sample Ztest is one of the most popular location tests. The null hypothesis is that the population mean value is equal to a given number, μ 0 \mu_0 μ 0 :
We perform a twotailed Ztest if we want to test whether the population mean is not μ 0 \mu_0 μ 0 :
and a onetailed Ztest if we want to test whether the population mean is less/greater than μ 0 \mu_0 μ 0 :
Let us now discuss the assumptions of a onesample Ztest.
When do I use Ztests?
You may use a Ztest if your sample consists of independent data points and:
the data is normally distributed , and you know the population variance ;
the sample is large , and data follows a distribution which has a finite mean and variance. You don't need to know the population variance.
The reason these two possibilities exist is that we want the test statistics that follow the standard normal distribution N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) . In the former case, it is an exact standard normal distribution, while in the latter, it is approximately so, thanks to the central limit theorem.
The question remains, "When is my sample considered large?" Well, there's no universal criterion. In general, the more data points you have, the better the approximation works. Statistics textbooks recommend having no fewer than 50 data points, while 30 is considered the bare minimum.
Ztest formula
Let x 1 , . . . , x n x_1, ..., x_n x 1 , ... , x n be an independent sample following the normal distribution N ( μ , σ 2 ) \mathrm N(\mu, \sigma^2) N ( μ , σ 2 ) , i.e., with a mean equal to μ \mu μ , and variance equal to σ 2 \sigma ^2 σ 2 .
We pose the null hypothesis, H 0 : μ = μ 0 \mathrm H_0 \!\!:\!\! \mu = \mu_0 H 0 : μ = μ 0 .
We define the test statistic, Z , as:
x ˉ \bar x x ˉ is the sample mean, i.e., x ˉ = ( x 1 + . . . + x n ) / n \bar x = (x_1 + ... + x_n) / n x ˉ = ( x 1 + ... + x n ) / n ;
μ 0 \mu_0 μ 0 is the mean postulated in H 0 \mathrm H_0 H 0 ;
n n n is sample size; and
σ \sigma σ is the population standard deviation.
In what follows, the uppercase Z Z Z stands for the test statistic (treated as a random variable), while the lowercase z z z will denote an actual value of Z Z Z , computed for a given sample drawn from N(μ,σ²).
If H 0 \mathrm H_0 H 0 holds, then the sum S n = x 1 + . . . + x n S_n = x_1 + ... + x_n S n = x 1 + ... + x n follows the normal distribution, with mean n μ 0 n \mu_0 n μ 0 and variance n 2 σ n^2 \sigma n 2 σ . As Z Z Z is the standardization (zscore) of S n / n S_n/n S n / n , we can conclude that the test statistic Z Z Z follows the standard normal distribution N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) , provided that H 0 \mathrm H_0 H 0 is true. By the way, we have the zscore calculator if you want to focus on this value alone.
If our data does not follow a normal distribution, or if the population standard deviation is unknown (and thus in the formula for Z Z Z we substitute the population standard deviation σ \sigma σ with sample standard deviation), then the test statistics Z Z Z is not necessarily normal. However, if the sample is sufficiently large, then the central limit theorem guarantees that Z Z Z is approximately N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) .
In the sections below, we will explain to you how to use the value of the test statistic, z z z , to make a decision , whether or not you should reject the null hypothesis . Two approaches can be used in order to arrive at that decision: the pvalue approach, and critical value approach  and we cover both of them! Which one should you use? In the past, the critical value approach was more popular because it was difficult to calculate pvalue from Ztest. However, with help of modern computers, we can do it fairly easily, and with decent precision. In general, you are strongly advised to report the pvalue of your tests!
pvalue from Ztest
Formally, the pvalue is the smallest level of significance at which the null hypothesis could be rejected. More intuitively, pvalue answers the questions: provided that I live in a world where the null hypothesis holds, how probable is it that the value of the test statistic will be at least as extreme as the z z z  value I've got for my sample? Hence, a small pvalue means that your result is very improbable under the null hypothesis, and so there is strong evidence against the null hypothesis  the smaller the pvalue, the stronger the evidence.
To find the pvalue, you have to calculate the probability that the test statistic, Z Z Z , is at least as extreme as the value we've actually observed, z z z , provided that the null hypothesis is true. (The probability of an event calculated under the assumption that H 0 \mathrm H_0 H 0 is true will be denoted as P r ( event ∣ H 0 ) \small \mathrm{Pr}(\text{event}  \mathrm{H_0}) Pr ( event ∣ H 0 ) .) It is the alternative hypothesis which determines what more extreme means :
 Twotailed Ztest: extreme values are those whose absolute value exceeds ∣ z ∣ z ∣ z ∣ , so those smaller than − ∣ z ∣ z − ∣ z ∣ or greater than ∣ z ∣ z ∣ z ∣ . Therefore, we have:
The symmetry of the normal distribution gives:
 Lefttailed Ztest: extreme values are those smaller than z z z , so
 Righttailed Ztest: extreme values are those greater than z z z , so
To compute these probabilities, we can use the cumulative distribution function, (cdf) of N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) , which for a real number, x x x , is defined as:
Also, pvalues can be nicely depicted as the area under the probability density function (pdf) of N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) , due to:
Twotailed Ztest and onetailed Ztest
With all the knowledge you've got from the previous section, you're ready to learn about Ztests.
 Twotailed Ztest:
From the fact that Φ ( − z ) = 1 − Φ ( z ) \Phi(z) = 1  \Phi(z) Φ ( − z ) = 1 − Φ ( z ) , we deduce that
The pvalue is the area under the probability distribution function (pdf) both to the left of − ∣ z ∣ z − ∣ z ∣ , and to the right of ∣ z ∣ z ∣ z ∣ :
 Lefttailed Ztest:
The pvalue is the area under the pdf to the left of our z z z :
 Righttailed Ztest:
The pvalue is the area under the pdf to the right of z z z :
The decision as to whether or not you should reject the null hypothesis can be now made at any significance level, α \alpha α , you desire!
if the pvalue is less than, or equal to, α \alpha α , the null hypothesis is rejected at this significance level; and
if the pvalue is greater than α \alpha α , then there is not enough evidence to reject the null hypothesis at this significance level.
Ztest critical values & critical regions
The critical value approach involves comparing the value of the test statistic obtained for our sample, z z z , to the socalled critical values . These values constitute the boundaries of regions where the test statistic is highly improbable to lie . Those regions are often referred to as the critical regions , or rejection regions . The decision of whether or not you should reject the null hypothesis is then based on whether or not our z z z belongs to the critical region.
The critical regions depend on a significance level, α \alpha α , of the test, and on the alternative hypothesis. The choice of α \alpha α is arbitrary; in practice, the values of 0.1, 0.05, or 0.01 are most commonly used as α \alpha α .
Once we agree on the value of α \alpha α , we can easily determine the critical regions of the Ztest:
To decide the fate of H 0 \mathrm H_0 H 0 , check whether or not your z z z falls in the critical region:
If yes, then reject H 0 \mathrm H_0 H 0 and accept H 1 \mathrm H_1 H 1 ; and
If no, then there is not enough evidence to reject H 0 \mathrm H_0 H 0 .
As you see, the formulae for the critical values of Ztests involve the inverse, Φ − 1 \Phi^{1} Φ − 1 , of the cumulative distribution function (cdf) of N ( 0 , 1 ) \mathrm N(0, 1) N ( 0 , 1 ) .
How to use the onesample Ztest calculator?
Our calculator reduces all the complicated steps:
Choose the alternative hypothesis: twotailed or left/righttailed.
In our Ztest calculator, you can decide whether to use the pvalue or critical regions approach. In the latter case, set the significance level, α \alpha α .
Enter the value of the test statistic, z z z . If you don't know it, then you can enter some data that will allow us to calculate your z z z for you:
 sample mean x ˉ \bar x x ˉ (If you have raw data, go to the average calculator to determine the mean);
 tested mean μ 0 \mu_0 μ 0 ;
 sample size n n n ; and
 population standard deviation σ \sigma σ (or sample standard deviation if your sample is large).
Results appear immediately below the calculator.
If you want to find z z z based on pvalue , please remember that in the case of twotailed tests there are two possible values of z z z : one positive and one negative, and they are opposite numbers. This Ztest calculator returns the positive value in such a case. In order to find the other possible value of z z z for a given pvalue, just take the number opposite to the value of z z z displayed by the calculator.
Ztest examples
To make sure that you've fully understood the essence of Ztest, let's go through some examples:
 A bottle filling machine follows a normal distribution. Its standard deviation, as declared by the manufacturer, is equal to 30 ml. A juice seller claims that the volume poured in each bottle is, on average, one liter, i.e., 1000 ml, but we suspect that in fact the average volume is smaller than that...
Formally, the hypotheses that we set are the following:
H 0 : μ = 1000 ml \mathrm H_0 \! : \mu = 1000 \text{ ml} H 0 : μ = 1000 ml
H 1 : μ < 1000 ml \mathrm H_1 \! : \mu \lt 1000 \text{ ml} H 1 : μ < 1000 ml
We went to a shop and bought a sample of 9 bottles. After carefully measuring the volume of juice in each bottle, we've obtained the following sample (in milliliters):
1020 , 970 , 1000 , 980 , 1010 , 930 , 950 , 980 , 980 \small 1020, 970, 1000, 980, 1010, 930, 950, 980, 980 1020 , 970 , 1000 , 980 , 1010 , 930 , 950 , 980 , 980 .
Sample size: n = 9 n = 9 n = 9 ;
Sample mean: x ˉ = 980 m l \bar x = 980 \ \mathrm{ml} x ˉ = 980 ml ;
Population standard deviation: σ = 30 m l \sigma = 30 \ \mathrm{ml} σ = 30 ml ;
And, therefore, pvalue = Φ ( − 2 ) ≈ 0.0228 \text{pvalue} = \Phi(2) \approx 0.0228 pvalue = Φ ( − 2 ) ≈ 0.0228 .
As 0.0228 < 0.05 0.0228 \lt 0.05 0.0228 < 0.05 , we conclude that our suspicions aren't groundless; at the most common significance level, 0.05, we would reject the producer's claim, H 0 \mathrm H_0 H 0 , and accept the alternative hypothesis, H 1 \mathrm H_1 H 1 .
We tossed a coin 50 times. We got 20 tails and 30 heads. Is there sufficient evidence to claim that the coin is biased?
Clearly, our data follows Bernoulli distribution, with some success probability p p p and variance σ 2 = p ( 1 − p ) \sigma^2 = p (1p) σ 2 = p ( 1 − p ) . However, the sample is large, so we can safely perform a Ztest. We adopt the convention that getting tails is a success.
Let us state the null and alternative hypotheses:
H 0 : p = 0.5 \mathrm H_0 \! : p = 0.5 H 0 : p = 0.5 (the coin is fair  the probability of tails is 0.5 0.5 0.5 )
H 1 : p ≠ 0.5 \mathrm H_1 \! : p \ne 0.5 H 1 : p = 0.5 (the coin is biased  the probability of tails differs from 0.5 0.5 0.5 )
In our sample we have 20 successes (denoted by ones) and 30 failures (denoted by zeros), so:
Sample size n = 50 n = 50 n = 50 ;
Sample mean x ˉ = 20 / 50 = 0.4 \bar x = 20/50 = 0.4 x ˉ = 20/50 = 0.4 ;
Population standard deviation is given by σ = 0.5 × 0.5 \sigma = \sqrt{0.5 \times 0.5} σ = 0.5 × 0.5 (because 0.5 0.5 0.5 is the proportion p p p hypothesized in H 0 \mathrm H_0 H 0 ). Hence, σ = 0.5 \sigma = 0.5 σ = 0.5 ;
 And, therefore
Since 0.1573 > 0.1 0.1573 \gt 0.1 0.1573 > 0.1 we don't have enough evidence to reject the claim that the coin is fair , even at such a large significance level as 0.1 0.1 0.1 . In that case, you may safely toss it to your Witcher or use the coin flip probability calculator to find your chances of getting, e.g., 10 heads in a row (which are extremely low!).
What is the difference between Ztest vs ttest?
We use a ttest for testing the population mean of a normally distributed dataset which had an unknown population standard deviation . We get this by replacing the population standard deviation in the Ztest statistic formula by the sample standard deviation, which means that this new test statistic follows (provided that H₀ holds) the tStudent distribution with n1 degrees of freedom instead of N(0,1) .
When should I use ttest over the Ztest?
For large samples, the tStudent distribution with n degrees of freedom approaches the N(0,1). Hence, as long as there are a sufficient number of data points (at least 30), it does not really matter whether you use the Ztest or the ttest, since the results will be almost identical. However, for small samples with unknown variance, remember to use the ttest instead of Ztest .
How do I calculate the Z test statistic?
To calculate the Z test statistic:
 Compute the arithmetic mean of your sample .
 From this mean subtract the mean postulated in null hypothesis .
 Multiply by the square root of size sample .
 Divide by the population standard deviation .
 That's it, you've just computed the Z test statistic!
Here, we perform a Ztest for population mean μ. Null hypothesis H₀: μ = μ₀.
Alternative hypothesis H₁
Significance level α
The probability that we reject the true hypothesis H₀ (type I error).
Z test is a statistical test that is conducted on data that approximately follows a normal distribution. The z test can be performed on one sample, two samples, or on proportions for hypothesis testing. It checks if the means of two large samples are different or not when the population variance is known.
A z test can further be classified into lefttailed, righttailed, and twotailed hypothesis tests depending upon the parameters of the data. In this article, we will learn more about the z test, its formula, the z test statistic, and how to perform the test for different types of data using examples.
1.  
2.  
3.  
4.  
5.  
6. 
What is Z Test?
A z test is a test that is used to check if the means of two populations are different or not provided the data follows a normal distribution. For this purpose, the null hypothesis and the alternative hypothesis must be set up and the value of the z test statistic must be calculated. The decision criterion is based on the z critical value.
Z Test Definition
A z test is conducted on a population that follows a normal distribution with independent data points and has a sample size that is greater than or equal to 30. It is used to check whether the means of two populations are equal to each other when the population variance is known. The null hypothesis of a z test can be rejected if the z test statistic is statistically significant when compared with the critical value.
Z Test Formula
The z test formula compares the z statistic with the z critical value to test whether there is a difference in the means of two populations. In hypothesis testing , the z critical value divides the distribution graph into the acceptance and the rejection regions. If the test statistic falls in the rejection region then the null hypothesis can be rejected otherwise it cannot be rejected. The z test formula to set up the required hypothesis tests for a one sample and a twosample z test are given below.
OneSample Z Test
A onesample 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 = \(\frac{\overline{x}\mu}{\frac{\sigma}{\sqrt{n}}}\). \(\overline{x}\) is the sample mean, \(\mu\) is the population mean, \(\sigma\) is the population standard deviation and n is the sample size.
The algorithm to set a one sample z test based on the z test statistic is given as follows:
Left Tailed Test:
Null Hypothesis: \(H_{0}\) : \(\mu = \mu_{0}\)
Alternate Hypothesis: \(H_{1}\) : \(\mu < \mu_{0}\)
Decision Criteria: If the z statistic < z critical value then reject the null hypothesis.
Right Tailed Test:
Alternate Hypothesis: \(H_{1}\) : \(\mu > \mu_{0}\)
Decision Criteria: If the z statistic > z critical value then reject the null hypothesis.
Two Tailed Test:
Alternate Hypothesis: \(H_{1}\) : \(\mu \neq \mu_{0}\)
Two Sample Z Test
A two sample z test is used to check if there is a difference between the means of two samples. The z test statistic formula is given as follows:
z = \(\frac{(\overline{x_{1}}\overline{x_{2}})(\mu_{1}\mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}}+\frac{\sigma_{2}^{2}}{n_{2}}}}\). \(\overline{x_{1}}\), \(\mu_{1}\), \(\sigma_{1}^{2}\) are the sample mean, population mean and population variance respectively for the first sample. \(\overline{x_{2}}\), \(\mu_{2}\), \(\sigma_{2}^{2}\) are the sample mean, population mean and population variance respectively for the second sample.
The twosample z test can be set up in the same way as the onesample test. However, this test will be used to compare the means of the two samples. For example, the null hypothesis is given as \(H_{0}\) : \(\mu_{1} = \mu_{2}\).
Z Test for Proportions
A z test for proportions is used to check the difference in proportions. A z test can either be used for one proportion or two proportions. The formulas are given as follows.
One Proportion Z Test
A one proportion z test is used when there are two groups and compares the value of an observed proportion to a theoretical one. The z test statistic for a one proportion z test is given as follows:
z = \(\frac{pp_{0}}{\sqrt{\frac{p_{0}(1p_{0})}{n}}}\). Here, p is the observed value of the proportion, \(p_{0}\) is the theoretical proportion value and n is the sample size.
The null hypothesis is that the two proportions are the same while the alternative hypothesis is that they are not the same.
Two Proportion Z Test
A two proportion z test is conducted on two proportions to check if they are the same or not. The test statistic formula is given as follows:
z =\(\frac{p_{1}p_{2}0}{\sqrt{p(1p)\left ( \frac{1}{n_{1}} +\frac{1}{n_{2}}\right )}}\)
where p = \(\frac{x_{1}+x_{2}}{n_{1}+n_{2}}\)
\(p_{1}\) is the proportion of sample 1 with sample size \(n_{1}\) and \(x_{1}\) number of trials.
\(p_{2}\) is the proportion of sample 2 with sample size \(n_{2}\) and \(x_{2}\) number of trials.
How to Calculate Z Test Statistic?
The most important step in calculating the z test statistic is to interpret the problem correctly. It is necessary to determine which tailed test needs to be conducted and what type of test does the z statistic belong to. Suppose a teacher claims that his section's students will score higher than his colleague's section. The mean score is 22.1 for 60 students belonging to his section with a standard deviation of 4.8. For his colleague's section, the mean score is 18.8 for 40 students and the standard deviation is 8.1. Test his claim at \(\alpha\) = 0.05. The steps to calculate the z test statistic are as follows:
 Identify the type of test. In this example, the means of two populations have to be compared in one direction thus, the test is a righttailed twosample z test.
 Set up the hypotheses. \(H_{0}\): \(\mu_{1} = \mu_{2}\), \(H_{1}\): \(\mu_{1} > \mu_{2}\).
 Find the critical value at the given alpha level using the z table. The critical value is 1.645.
 Determine the z test statistic using the appropriate formula. This is given by z = \(\frac{(\overline{x_{1}}\overline{x_{2}})(\mu_{1}\mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}}+\frac{\sigma_{2}^{2}}{n_{2}}}}\). Substitute values in this equation. \(\overline{x_{1}}\) = 22.1, \(\sigma_{1}\) = 4.8, \(n_{1}\) = 60, \(\overline{x_{2}}\) = 18.8, \(\sigma_{2}\) = 8.1, \(n_{2}\) = 40 and \(\mu_{1}  \mu_{2} = 0\). Thus, z = 2.32
 Compare the critical value and test statistic to arrive at a conclusion. As 2.32 > 1.645 thus, the null hypothesis can be rejected. It can be concluded that there is enough evidence to support the teacher's claim that the scores of students are better in his class.
Z Test vs TTest
Both z test and ttest are univariate tests used on the means of two datasets. The differences between both tests are outlined in the table given below:
Z Test  TTest 

A z test is a statistical test that is used to check if the means of two data sets are different when the population variance is known.  A is used to check if the means of two data sets are different when the population variance is not known. 
The sample size is greater than or equal to 30.  The sample size is lesser than 30. 
The follows a normal distribution.  The data follows a studentt distribution. 
The onesample z test statistic is given by \(\frac{\overline{x}\mu}{\frac{\sigma}{\sqrt{n}}}\)  The t test statistic is given as \(\frac{\overline{x}\mu}{\frac{s}{\sqrt{n}}}\) where s is the sample standard deviation 
Related Articles:
 Probability and Statistics
 Data Handling
 Summary Statistics
Important Notes on Z Test
 Z test is a statistical test that is conducted on normally distributed data to check if there is a difference in means of two data sets.
 The sample size should be greater than 30 and the population variance must be known to perform a z test.
 The onesample z test checks if there is a difference in the sample and population mean,
 The two sample z test checks if the means of two different groups are equal.
Examples on Z Test
Example 1: A teacher claims that the mean score of students in his class is greater than 82 with a standard deviation of 20. If a sample of 81 students was selected with a mean score of 90 then check if there is enough evidence to support this claim at a 0.05 significance level.
Solution: As the sample size is 81 and population standard deviation is known, this is an example of a righttailed onesample z test.
\(H_{0}\) : \(\mu = 82\)
\(H_{1}\) : \(\mu > 82\)
From the z table the critical value at \(\alpha\) = 1.645
z = \(\frac{\overline{x}\mu}{\frac{\sigma}{\sqrt{n}}}\)
\(\overline{x}\) = 90, \(\mu\) = 82, n = 81, \(\sigma\) = 20
As 3.6 > 1.645 thus, the null hypothesis is rejected and it is concluded that there is enough evidence to support the teacher's claim.
Answer: Reject the null hypothesis
Example 2: An online medicine shop claims that the mean delivery time for medicines is less than 120 minutes with a standard deviation of 30 minutes. Is there enough evidence to support this claim at a 0.05 significance level if 49 orders were examined with a mean of 100 minutes?
Solution: As the sample size is 49 and population standard deviation is known, this is an example of a lefttailed onesample z test.
\(H_{0}\) : \(\mu = 120\)
\(H_{1}\) : \(\mu < 120\)
From the z table the critical value at \(\alpha\) = 1.645. A negative sign is used as this is a left tailed test.
\(\overline{x}\) = 100, \(\mu\) = 120, n = 49, \(\sigma\) = 30
As 4.66 < 1.645 thus, the null hypothesis is rejected and it is concluded that there is enough evidence to support the medicine shop's claim.
Example 3: A company wants to improve the quality of products by reducing defects and monitoring the efficiency of assembly lines. In assembly line A, there were 18 defects reported out of 200 samples while in line B, 25 defects out of 600 samples were noted. Is there a difference in the procedures at a 0.05 alpha level?
Solution: This is an example of a twotailed two proportion z test.
\(H_{0}\): The two proportions are the same.
\(H_{1}\): The two proportions are not the same.
As this is a twotailed test the alpha level needs to be divided by 2 to get 0.025.
Using this, the critical value from the z table is 1.96.
\(n_{1}\) = 200, \(n_{2}\) = 600
\(p_{1}\) = 18 / 200 = 0.09
\(p_{2}\) = 25 / 600 = 0.0416
p = (18 + 25) / (200 + 600) = 0.0537
z =\(\frac{p_{1}p_{2}0}{\sqrt{p(1p)\left ( \frac{1}{n_{1}} +\frac{1}{n_{2}}\right )}}\) = 2.62
As 2.62 > 1.96 thus, the null hypothesis is rejected and it is concluded that there is a significant difference between the two lines.
go to slide go to slide go to slide
Book a Free Trial Class
FAQs on Z Test
What is a z test in statistics.
A z test in statistics is conducted on data that is normally distributed to test if the means of two datasets are equal. It can be performed when the sample size is greater than 30 and the population variance is known.
What is a OneSample Z Test?
A onesample z test is used when the population standard deviation is known, to compare the sample mean and the population mean. The z test statistic is given by the formula \(\frac{\overline{x}\mu}{\frac{\sigma}{\sqrt{n}}}\).
What is the TwoSample Z Test Formula?
The two sample z test is used when the means of two populations have to be compared. The z test formula is given as \(\frac{(\overline{x_{1}}\overline{x_{2}})(\mu_{1}\mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}}+\frac{\sigma_{2}^{2}}{n_{2}}}}\).
What is a One Proportion Z test?
A one proportion z test is used to check if the value of the observed proportion is different from the value of the theoretical proportion. The z statistic is given by \(\frac{pp_{0}}{\sqrt{\frac{p_{0}(1p_{0})}{n}}}\).
What is a Two Proportion Z Test?
When the proportions of two samples have to be compared then the two proportion z test is used. The formula is given by \(\frac{p_{1}p_{2}0}{\sqrt{p(1p)\left ( \frac{1}{n_{1}} +\frac{1}{n_{2}}\right )}}\).
How Do You Find the Z Test?
The steps to perform the z test are as follows:
 Set up the null and alternative hypotheses.
 Find the critical value using the alpha level and z table.
 Calculate the z statistic.
 Compare the critical value and the test statistic to decide whether to reject or not to reject the null hypothesis.
What is the Difference Between the Z Test and the TTest?
A z test is used on large samples n ≥ 30 and normally distributed data while a ttest is used on small samples (n < 30) following a student t distribution . Both tests are used to check if the means of two datasets are the same.
Z Test: Definition & Two Proportion ZTest
What is a z test.
For example, if someone said they had found a new drug that cures cancer, you would want to be sure it was probably true. A hypothesis test will tell you if it’s probably true, or probably not true. A Z test, is used when your data is approximately normally distributed (i.e. the data has the shape of a bell curve when you graph it).
When you can run a Z Test.
Several different types of tests are used in statistics (i.e. f test , chi square test , t test ). You would use a Z test if:
 Your sample size is greater than 30 . Otherwise, use a t test .
 Data points should be independent from each other. In other words, one data point isn’t related or doesn’t affect another data point.
 Your data should be normally distributed . However, for large sample sizes (over 30) this doesn’t always matter.
 Your data should be randomly selected from a population, where each item has an equal chance of being selected.
 Sample sizes should be equal if at all possible.
How do I run a Z Test?
Running a Z test on your data requires five steps:
 State the null hypothesis and alternate hypothesis .
 Choose an alpha level .
 Find the critical value of z in a z table .
 Calculate the z test statistic (see below).
 Compare the test statistic to the critical z value and decide if you should support or reject the null hypothesis .
You could perform all these steps by hand. For example, you could find a critical value by hand , or calculate a z value by hand . For a step by step example, watch the following video: Watch the video for an example:
Can’t see the video? Click here to watch it on YouTube. You could also use technology, for example:
 Two sample z test in Excel .
 Find a critical z value on the TI 83 .
 Find a critical value on the TI 89 (lefttail) .
Two Proportion ZTest
Watch the video to see a two proportion ztest:
Can’t see the video? Click here to watch it on YouTube.
A Two Proportion ZTest (or Zinterval) allows you to calculate the true difference in proportions of two independent groups to a given confidence interval .
There are a few familiar conditions that need to be met for the Two Proportion ZInterval to be valid.
 The groups must be independent. Subjects can be in one group or the other, but not both – like teens and adults.
 The data must be selected randomly and independently from a homogenous population. A survey is a common example.
 The population should be at least ten times bigger than the sample size. If the population is teenagers for example, there should be at least ten times as many total teenagers as the number of teenagers being surveyed.
 The null hypothesis (H 0 ) for the test is that the proportions are the same.
 The alternate hypothesis (H 1 ) is that the proportions are not the same.
Example question: let’s say you’re testing two flu drugs A and B. Drug A works on 41 people out of a sample of 195. Drug B works on 351 people in a sample of 605. Are the two drugs comparable? Use a 5% alpha level .
Step 1: Find the two proportions:
 P 1 = 41/195 = 0.21 (that’s 21%)
 P 2 = 351/605 = 0.58 (that’s 58%).
Set these numbers aside for a moment.
Step 2: Find the overall sample proportion . The numerator will be the total number of “positive” results for the two samples and the denominator is the total number of people in the two samples.
 p = (41 + 351) / (195 + 605) = 0.49.
Set this number aside for a moment.
Solving the formula, we get: Z = 8.99
We need to find out if the zscore falls into the “ rejection region .”
Step 5: Compare the calculated zscore from Step 3 with the table zscore from Step 4. If the calculated zscore is larger, you can reject the null hypothesis.
8.99 > 1.96, so we can reject the null hypothesis .
Example 2: Suppose that in a survey of 700 women and 700 men, 35% of women and 30% of men indicated that they support a particular presidential candidate. Let’s say we wanted to find the true difference in proportions of these two groups to a 95% confidence interval .
At first glance the survey indicates that women support the candidate more than men by about 5% . However, for this statistical inference to be valid we need to construct a range of values to a given confidence interval.
To do this, we use the formula for Two Proportion ZInterval:
Plugging in values we find the true difference in proportions to be
Based on the results of the survey, we are 95% confident that the difference in proportions of women and men that support the presidential candidate is between about 0 % and 10% .
Check out our YouTube channel for more stats help and tips!
Microbe Notes
ZTest: Formula, Examples, Uses, ZTest vs TTest
Table of Contents
Interesting Science Videos
Ztest Definition
ztest 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 ttests, z tests are also based on normal probability distribution.
 Ztest 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 ztest, the variance is usually known.
 Ztest is more convenient than ttest as the critical value at each significance level in the confidence interval is the sample for all sample sizes.
 A zscore is a number indicating how many standard deviations above or below the mean of the population is.
Ztest formula
For the normal population with one sample:
where x̄ is the mean of the sample, and µ is the assumed mean, σ is the standard deviation, and n is the number of observations.
ztest for the difference in mean:
where x̄ 1 and x̄ 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 ztest (onetailed ztest)
 One sample ztest 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 zvalue of the sample being tested falls into the criteria for the onesided tets, the alternative hypothesis will be accepted instead of the null hypothesis.
 A onetailed 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 onesample ztest 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 onesided ztest can be either a leftsided ztest or a rightsided ztest.
 For instance, if our H 0 : µ 0 = µ and H a : µ < µ 0 , such a test would be a onesided test or more precisely, a lefttailed test and there is one rejection area only on the left tail of the distribution.
 However, if H 0 : µ = µ 0 and H a : µ > µ 0 , this is also a onetailed test (right tail), and the rejection region is present on the right tail of the curve.
Two sample ztest (twotailed ztest)
 In the case of two sample ztest, two normally distributed independent samples are required.
 A twotailed ztest is performed to determine the relationship between the population parameters of the two samples.
 In the case of the twotailed ztest, the alternative hypothesis is accepted as long as the population parameter is not equal to the assumed value.
 The twotailed test is appropriate when we have H 0 : µ = µ 0 and H a : µ ≠ µ 0 which may mean µ > µ 0 or µ < µ 0
 Thus, in a twotailed test, there are two rejection regions, one on each tail of the curve.
Ztest 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:
H 0 : µ = 67 . 39 “
H a : µ ≠ 67 . 39 “
x̄ = 67 . 47 “, σ = 1 . 30 “, n = 400
Assuming the population to be normal, we can work out the test statistic z as under:
ztest applications
 Ztest 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 ztest 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.
Ztest vs Ttest (8 major differences)



The ttest 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.  ztest 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.  
The ttest is usually performed in samples of a smaller size (n≤30).  ztest is generally performed in samples of a larger size (n>30).  
ttest is performed on samples distributed on the basis of tdistribution.  ztets is performed on samples that are normally distributed.  
A ttest is not based on the assumption that all key points on the sample are independent.  ztest is based on the assumption that all key points on the sample are independent.  
Variance or standard deviation is not known in the ttest.  Variance or standard deviation is known in ztest.  
The 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.  
In addition, to the mean, the ttest can also be used to compare partial or simple correlations among two samples.  In addition, to mean, ztest can also be used to compare the population proportion.  
ttests are less convenient as they have separate critical values for different sample sizes.  ztest 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://ncsswpengine.netdnassl.com/wpcontent/themes/ncss/pdf/Procedures/PASS/OneSample_ZTests.pdf
 https://www.wallstreetmojo.com/ztestvsttest/
 https://sites.google.com/site/fundamentalstatistics/chapter13
 3% – https://www.investopedia.com/terms/z/ztest.asp
 2% – https://www.coursehero.com/file/61052903/Questionsstatisticswpdf/
 2% – https://towardsdatascience.com/everythingyouneedtoknowabouthypothesistestingparti4de9abebbc8a
 2% – https://ncsswpengine.netdnassl.com/wpcontent/themes/ncss/pdf/Procedures/PASS/OneSample_ZTests.pdf
 1% – https://www.slideshare.net/MuhammadAnas96/ztestwithexamples
 1% – https://www.mathandstatistics.com/learnstats/hypothesistesting/twotailedztesthypothesistestbyhand
 1% – https://www.infrrr.com/proportions/differenceinproportionshypothesistestcalculator
 1% – https://keydifferences.com/differencebetweenttestandztest.html
 1% – https://en.wikipedia.org/wiki/Ztest
 1% – http://www.sci.utah.edu/~arpaiva/classes/UT_ece3530/hypothesis_testing.pdf
 <1% – https://www.researchgate.net/post/Cananullhypothesisbestatedasadifference
 <1% – https://www.isixsigma.com/toolstemplates/hypothesistesting/makingsensetwosamplettest/
 <1% – https://www.investopedia.com/terms/t/twotailedtest.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
Anupama Sapkota
2 thoughts on “ZTest: Formula, Examples, Uses, ZTest vs TTest”
The formula for Z test provided for testing the single mean is wrong. The correct formula is wrong. Please check and correct it. It should be Z = (𝑥̅−𝜇)/𝜎/√n
Hi Ramnath, Sorry for the mistake. Thank you so much for the correction. We have updated the page with correct formula.
Leave a Comment Cancel reply
Save my name, email, and website in this browser for the next time I comment.
ZTest for Statistical Hypothesis Testing Explained
The Ztest is a statistical hypothesis test that determines where the distribution of the statistic we are measuring, like the mean, is part of the normal distribution.
The Ztest is a statistical hypothesis test used to determine where the distribution of the test statistic we are measuring, like the mean , is part of the normal distribution .
There are multiple types of Ztests, however, we’ll focus on the easiest and most well known one, the one sample mean test. This is used to determine if the difference between the mean of a sample and the mean of a population is statistically significant.
What Is a ZTest?
A Ztest is a type of statistical hypothesis test where the teststatistic follows a normal distribution.
The name Ztest comes from the Zscore of the normal distribution. This is a measure of how many standard deviations away a raw score or sample statistics is from the populations’ mean.
Ztests are the most common statistical tests conducted in fields such as healthcare and data science . Therefore, it’s an essential concept to understand.
Requirements for a ZTest
In order to conduct a Ztest, your statistics need to meet a few requirements, including:
 A Sample size that’s greater than 30. This is because we want to ensure our sample mean comes from a distribution that is normal. As stated by the c entral limit theorem , any distribution can be approximated as normally distributed if it contains more than 30 data points.
 The standard deviation and mean of the population is known .
 The sample data is collected/acquired randomly .
More on Data Science: What Is Bootstrapping Statistics?
ZTest Steps
There are four steps to complete a Ztest. Let’s examine each one.
4 Steps to a ZTest
 State the null hypothesis.
 State the alternate hypothesis.
 Choose your critical value.
 Calculate your Ztest statistics.
1. State the Null Hypothesis
The first step in a Ztest is to state the null hypothesis, H_0 . This what you believe to be true from the population, which could be the mean of the population, μ_0 :
2. State the Alternate Hypothesis
Next, state the alternate hypothesis, H_1 . This is what you observe from your sample. If the sample mean is different from the population’s mean, then we say the mean is not equal to μ_0:
3. Choose Your Critical Value
Then, choose your critical value, α , which determines whether you accept or reject the null hypothesis. Typically for a Ztest we would use a statistical significance of 5 percent which is z = +/ 1.96 standard deviations from the population’s mean in the normal distribution:
This critical value is based on confidence intervals.
4. Calculate Your ZTest Statistic
Compute the Ztest Statistic using the sample mean, μ_1 , the population mean, μ_0 , the number of data points in the sample, n and the population’s standard deviation, σ :
If the test statistic is greater (or lower depending on the test we are conducting) than the critical value, then the alternate hypothesis is true because the sample’s mean is statistically significant enough from the population mean.
Another way to think about this is if the sample mean is so far away from the population mean, the alternate hypothesis has to be true or the sample is a complete anomaly.
More on Data Science: Basic Probability Theory and Statistics Terms to Know
ZTest Example
Let’s go through an example to fully understand the onesample mean Ztest.
A school says that its pupils are, on average, smarter than other schools. It takes a sample of 50 students whose average IQ measures to be 110. The population, or the rest of the schools, has an average IQ of 100 and standard deviation of 20. Is the school’s claim correct?
The null and alternate hypotheses are:
Where we are saying that our sample, the school, has a higher mean IQ than the population mean.
Now, this is what’s called a rightsided, onetailed test as our sample mean is greater than the population’s mean. So, choosing a critical value of 5 percent, which equals a Zscore of 1.96 , we can only reject the null hypothesis if our Ztest statistic is greater than 1.96.
If the school claimed its students’ IQs were an average of 90, then we would use a lefttailed test, as shown in the figure above. We would then only reject the null hypothesis if our Ztest statistic is less than 1.96.
Computing our Ztest statistic, we see:
Therefore, we have sufficient evidence to reject the null hypothesis, and the school’s claim is right.
Hope you enjoyed this article on Ztests. In this post, we only addressed the most simple case, the onesample mean test. However, there are other types of tests, but they all follow the same process just with some small nuances.
Recent Data Science Articles
One Sample ZTest: Definition, Formula, and Example
A one sample ztest is used to test whether the mean of a population is less than, greater than, or equal to some specific value.
This test assumes that the population standard deviation is known.
This tutorial explains the following:
 The formula to perform a one sample ztest.
 The assumptions of a one sample ztest.
 An example of how to perform a one sample ztest.
Let’s jump in!
One Sample ZTest: Formula
A one sample ztest will always use one of the following null and alternative hypotheses:
1. TwoTailed ZTest
 H 0 : μ = μ 0 (population mean is equal to some hypothesized value μ 0 )
 H A : μ ≠ μ 0 (population mean is not equal to some hypothesized value μ 0 )
2. LeftTailed ZTest
 H 0 : μ ≥ μ 0 (population mean is greater than or equal to some hypothesized value μ 0 )
 H A : μ 0 (population mean is less than some hypothesized value μ 0 )
3. RightTailed ZTest
 H 0 : μ ≤ μ 0 (population mean is less than or equal to some hypothesized value μ 0 )
 H A : μ > μ 0 (population mean is greaer than some hypothesized value μ 0 )
We use the following formula to calculate the z test statistic:
z = ( x – μ 0 ) / (σ/√ n )
 x : sample mean
 μ 0 : hypothesized population mean
 σ: population standard deviation
 n: sample size
If the pvalue that corresponds to the z test statistic is less than your chosen significance level (common choices are 0.10, 0.05, and 0.01) then you can reject the null hypothesis .
One Sample ZTest: Assumptions
For the results of a one sample ztest to be valid, the following assumptions should be met:
 The data are continuous (not discrete).
 The data is a simple random sample from the population of interest.
 The data in the population is approximately normally distributed .
 The population standard deviation is known.
One Sample ZTest : Example
Suppose the IQ in a population is normally distributed with a mean of μ = 100 and standard deviation of σ = 15.
A scientist wants to know if a new medication affects IQ levels, so she recruits 20 patients to use it for one month and records their IQ levels at the end of the month:
To test this, she will perform a one sample ztest at significance level α = 0.05 using the following steps:
Step 1: Gather the sample data.
Suppose she collects a simple random sample with the following information:
 n (sample size) = 20
 x (sample mean IQ) = 103.05
Step 2: Define the hypotheses.
She will perform the one sample ztest with the following hypotheses:
 H 0 : μ = 100
 H A : μ ≠ 100
Step 3: Calculate the z test statistic.
The z test statistic is calculated as:
 z = (x – μ) / (σ√ n )
 z = (103.05 – 100) / (15/√ 20 )
 z = 0.90933
Step 4: Calculate the pvalue of the z test statistic.
According to the Z Score to P Value Calculator , the twotailed pvalue associated with z = 0.90933 is 0.36318 .
Step 5: Draw a conclusion.
Since the pvalue (0.36318) is not less than the significance level (.05), the scientist will fail to reject the null hypothesis.
There is not sufficient evidence to say that the new medication significantly affects IQ level.
Note: You can also perform this entire one sample ztest by using the One Sample ZTest Calculator .
Additional Resources
The following tutorials explain how to perform a one sample ztest using different statistical software:
How to Perform ZTests in Excel How to Perform ZTests in R How to Perform ZTests in Python
Pandas: How to Create Pivot Table with Sum of Values
How to use str_pad in r (with examples), related posts, threeway anova: definition & example, two sample ztest: definition, formula, and example, how to find a confidence interval for a..., an introduction to the exponential distribution, an introduction to the uniform distribution, the breuschpagan test: definition & example, population vs. sample: what’s the difference, introduction to multiple linear regression, dunn’s test for multiple comparisons, qualitative vs. quantitative variables: what’s the difference.
A Ztest is a type of statistical hypothesis test used to test the mean of a normally distributed test statistic. It tests whether there is a significant difference between an observed population mean and the population mean under the null hypothesis, H 0 .
A Ztest can only be used when the population variance is known (or can be estimated with a high degree of accuracy), or if the sample size of the experiment is large (typically n>30). Also, the test statistic must exhibit a normal distribution; if it exhibits a distribution that is clearly not normal, the Ztest is not applicable. In many cases, population parameters may not be known, or it may not be possible to estimate them accurately. In such cases, or in cases where the sample size is small, a Student's ttest is more appropriate.
How to conduct a Ztest
The procedure for conducting a Ztest is similar to that of other statistical hypothesis tests, and is generally as follows:
 State the null (H 0 ) and alternative hypotheses (H a ).
 Select a significance level, α.
 Calculate the Zscore.
 Determine the critical value(s) of Z or the pvalue.
 Compare the Zscore of the observed value to the critical value of Z (or compare the pvalue to α) to determine if the null hypothesis should be rejected in favor of the alternative hypothesis, or if the null hypothesis should not be rejected.
H 0 and H a
The null hypothesis is typically a statement of no difference. For example, assume that the average score received on the SAT by high schoolers in a given state was a 1200 with a known standard deviation. If the average score of students in a given high school is a 1230, we may use a Ztest to determine whether this result is better, statistically, than the state average. The null hypothesis in this case would be that the average score of students in the high school is not better than the state average, or H 0 : μ ≤ μ 0 , or μ ≤ 1200.
The alternative hypothesis is a statement of difference from the null hypothesis. It can take one of three forms:
 Given H 0 : μ ≤ μ 0 , H a : μ > μ 0
 Given H 0 : μ ≥ μ 0 , H a : μ 0
 Given H 0 : μ = μ 0 , H a : μ ≠ μ 0
In this example, it is believed that a score of 1230 is statistically significant, and that students in this high school performed better than the state average. Therefore, the alternative hypothesis takes on the first form in the list, H a : μ > μ 0 , or μ > 1200.
Significance level
The significance level, α, is the probability of a study rejecting the null hypothesis when the null hypothesis is true. Commonly used significance levels include 0.01, 0.05, and 0.10. A significance level of 0.05, or 5%, means that there is a 5% chance of concluding that a difference exists (thus rejecting H 0 ) when there is no actual difference. The lower the significance level, the more evidence required before the null hypothesis can be rejected. The significance level is compared to the pvalue: if a pvalue is less than the significance level, the null hypothesis is rejected in favor of the alternative hypothesis.
Calculating a Zscore is a necessary part of conducting a Ztest. A Zscore indicates the number of standard deviations that an observed value is from the mean in a standard normal distribution. For example, an observed value with a Zscore of 1.2 indicates that the observed value is 1.2 standard deviations from the mean. If the population mean and standard deviation are known, the Zscore is calculated using the following formula:
where μ is the mean of the population, σ is the standard deviation of the population, and x is the observed value. In many cases the population mean and standard deviation are not known. In such cases, these population parameters can be estimated using a sample mean and sample standard deviation, and the Zscore can be computed as follows:
where x is the sample mean, s is the sample standard deviation, and x is the observed value.
Critical value and pvalue
Once a Zscore has been calculated, there are two methods for drawing conclusions about the test statistic: using the critical value(s), or using a pvalue. To form a conclusion for a hypothesis test using a critical value, the Zscore of the observed value is compared to the critical value(s) of the selected significance level; to use a pvalue, the pvalue of the observed value is compared to the significance level.
Critical value
A critical value is a value that indicates the critical region(s) (or rejection region) of the standard normal distribution, where a critical region is the area of the distribution in which a value must lie in order to reject the null hypothesis.
The critical value is dependent on the significance level as well as whether a onetailed or twotailed test is being conducted. A onetailed test is used when we want to know if a value is significantly larger or smaller than the Zscore. There is only one critical region in a onetailed Ztest. It is either a lefttailed test (or lowertailed) or righttailed test (or uppertailed) based on the position of the critical region, as shown in the figure below.
The critical regions are shown in pink. If a test statistic lies within the pink region, the null hypothesis is rejected in favor of the alternative hypothesis. Otherwise, the null hypothesis is not rejected.
If a test value lies in either of the critical regions shown in pink, the null hypothesis is rejected in favor of the alternative hypothesis; if it lies within the green region, the null hypothesis is not rejected.
After selecting the significance level and type of test, the critical Z value can be determined using a Z table by finding the Z value that corresponds to the selected significance level. For example, for a onetailed test and a significance level of 0.05, find the probability closest to 0.05 and read the Z value that results in this probability; the Z value for α = 0.05 for a onetailed Ztest is 1.96 for a lefttailed Ztest and 1.96 for a righttailed Ztest. For a twotailed Ztest, divide α by 2, then determine the corresponding Zvalue. For α = 0.05, each tail will comprise an area of 0.025 in the standard normal distribution, which corresponds to Zvalues of 1.645 and 1.645. Thus, the critical regions are Z 1.645. The critical values for common significance levels are shown in the table below:
Critical value  

α  Lefttailed  Righttailed  Twotailed 
0.01  2.326  2.326  ± 2.576 
0.05  1.645  1.645  ± 1.96 
0.10  1.282  1.282  ± 1.645 
The pvalue indicates the probability of obtaining test results that are at least as extreme as the observed results, assuming that the null hypothesis is true. It tells us how likely it is for an outcome to occur solely based on chance. For example, a pvalue of 0.05 means that there is a 5% chance that an outcome occurred solely by chance. The smaller the pvalue, the less likely it is for an outcome to occur solely by chance, and the more evidence there is to reject the null hypothesis.
Like critical values, a pvalue can be determined using a Z table. For a lefttailed Ztest, the pvalue is the area under the standard normal distribution to the left of the Zscore of the observed value; for a righttailed Ztest, it is the area to the right of the Zscore; for a twotailed Ztest, it is the sum of the area to the left and right of the Zscore. If the pvalue is less than or equal to the significance level, the null hypothesis is rejected in favor of the alternative hypothesis. Otherwise, the null hypothesis is not rejected.
It is important to note that the pvalue is not the probability that the null hypothesis is true. It is the probability that the data could deviate from the null hypothesis as much, or more than it did. The calculation of the pvalue assumes that the null hypothesis is true, so it is not a measure of whether or not the null hypothesis is correct. Rather, it is a measure of how well the data fits the null hypothesis. Also, the pvalue (or critical value) may provide evidence that the null hypothesis should be rejected in favor of the alternative hypothesis at the chosen level of significance . This does not mean that the alternative hypothesis is being accepted, because it is possible that the null hypothesis would not be rejected at a different significance level. Similarly, if the pvalue is greater than the significance level, this does not mean that the null hypothesis is being accepted, just that the null hypothesis is not rejected.
Finally, pvalues and critical values only indicate statistical significance, and may not necessarily indicate that the study's findings are significant within their context. For example, if a new medicine and a placebo are tested on different populations, and the medicine is found to have a statistically significant effect, it may not necessarily mean that there is clinical significance. It is possible for a finding to be both statistically and clinically significant, or only one or the other. For large sample sizes, it is possible for results to indicate statistical significance even when the effect is actually small and unimportant. Conversely, a small sample may not exhibit statistical significance even when the effect is large and potentially important. Thus, it is important to fully understand the scope of a study, as well as the statistical methods used, in order to effectively interpret the results and draw accurate, unbiased conclusions.
The average score on a national mathematics exam taken by high school seniors is an 82 with a standard deviation of 8. A sample of 1000 seniors achieved an average score of 68. Perform a Ztest to determine whether there is a statistically significant difference between the national average and that of the sample of seniors at a significance level of 0.05.
We want to determine whether there is any difference, so the null hypothesis is that there is no difference, or
H 0 : μ = 82
and the alternative hypothesis is:
H a : μ ≠ 82
Thus, a twotailed Ztest should be conducted since differences on either side of the distribution must be accounted for.
The selected significance level is:
α = 0.05
This value must be greater than the pvalue in order to conclude that the difference in scores is statistically significant.
Since the population standard deviation and mean are known, the Zscore can be computed as:
Based on the selected significance level and the use of a twotailed Ztest, the critical values are Z = ± 1.96. Since the Zscore of the observed value lies between both tails (rather than within one of them), we fail to reject the null hypothesis, as depicted in the figure below.
Thus, we conclude that the difference between the observed mean and the population mean is not statistically significant for a significance level of 0.05.
However, had we selected a significance level of 0.10, the critical values would be Z = ±1.645, and Z = 1.75 would lie within the left tail of the distribution. In this case, we would reject the null hypothesis in favor of the alternative hypothesis, and conclude that the observed value is statistically significant for a significance level of 0.10.
The above discussion involved hypothesis testing for one sample, where an observed value was compared to the expected population parameter. In certain cases, scientists may want to compare the means of two samples. In such cases, a twosample Ztest is used instead.
Twosample Ztest
A twosample Ztest is conducted using the same procedures described above for a onesample Ztest, with the exception that the Zscore is computed using the following formula:
where μ 1 and μ 2 are the means of the two respective populations, x 1 and x 2 are the sample means, and n 1 and n 2 are the sample sizes.
Researchers want to test whether a certain drug has any effect on the scores received by patients who are administered the drug prior to performing a physical stress test. The researchers place patients into 2 groups: 500 are placed into the experimental group and are administered the drug; 300 are placed into the control group and are administered a placebo. Both groups then perform the physical stress test, the results of which are as follows:
Experimental group:  x = 50; σ = 16; n = 100 
Control group:  x = 45; σ = 13; n = 150 
Determine whether or not there is a statistically significant difference between the two groups at a significance level of 0.05.
The null hypothesis is that there is no difference, so:
H 0 : μ 1 = μ 2
Also, since it is assumed that the null hypothesis is true, μ 1  μ 2 = 0.
The alternative hypothesis is that there is a difference, so:
H a : μ 1 ≠ μ 2
The selected significance level is 0.05, and we conduct a twotailed test since we are looking for any observable difference.
The Zscore is then calculated as follows:
Using a Z table (or a pvalue calculator), the pvalue for a twotailed Ztest for a Zscore of 2.604 is 0.009214. Since the pvalue is less than the selected significance level, we reject the null hypothesis in favor of the alternative hypothesis, and conclude that the drug has a statistically significant effect on the performance of the patients. Since the Zscore lies in the right tail, we may conclude that patients who received the drug scored significantly better than those who received the placebo. If the Zscore were to lie in left tail, we would conclude the opposite: that patients who received the drug performed significantly worse.
We could also have used the critical values Z = ±1.96 for a significance level of 0.05 to reach the same conclusion, since 2.604 lies within the critical region denoted by the right tail of the distribution, as shown in the figure below.
Learn Math and Stats with Dr. G
A shortcut is the longest distance between two points.
TwoTailed ztest Hypothesis Test By Hand
Running a TwoTailed ztest Hypothesis Test by Hand
HOW TO Video ztest Using Excel
Suppose it is up to you to determine if a certain state (Michigan) receives a significantly different amount of public school funding (per student) than the USA average. You know that the USA mean public school yearly funding is $6800 per student per year, with a standard deviation of $400.
Next, suppose you collect a sample (n = 100) from Michigan and determine that the sample mean for Michigan (per student per year) is $6873
Use the ztest and the correct Ho and Ha to run a hypothesis test to determine if Michigan receives a significantly different amount of funding for public school education (per student per year).
NOTE: This entire example works the same way if you have a dataset. Using the dataset, you would need to first calculate the sample mean. To run a ztest, it is generally expected that you have a larger sample size (30 or more) and that you have information about the population mean and standard deviation. If you do not have this information, it is sometimes best to use the ttest.
Step 1: Set up your hypothesis
Hypothesis: The mean per student per year funding in Michigan is significantly different than the average per student per year funding over the entire USA.
Step 2: Create Ho and Ha
NOTE: There are many ways to write out Ho.
Ho: mean per student per year funding for Michigan = mean per student per year funding for the USA
This can also be written as the following. Ho: Michigan mean – Population mean = 0
Ha: mean per student per year funding for Michigan ≠ mean per student per year funding for the USA
NOTICE1: The Ha in this example is TWOTAILED because we are interested in seeing if Michigan is significantly different than the population mean. In a twotailed test, the Ha contains a NOT EQUAL and the test will see if there is a significant difference (greater or smaller).
NOTICE2: The Ho is the null hypothesis and so always contains the equal sign as it is the case for which there is no significant difference between the two groups.
Step 3: Calculate the ztest statistic
Now, calculate the test statistic. In this example, we are using the ztest and are doing this by hand. However, there are many applications that run such tests. This Site has several examples under the Stats Apps link.
z = (sample mean – population mean) / [population standard deviation/sqrt(n)]
z = (6873 – 6800) / [400/sqrt(100)]
z = 73 / [400/10]
z = 73/ [40]
So, the ztest result, also called the test statistic is 1.825.
Step 4: Using the ztable, determine the rejection regions for you ztest. To do this, you must first select an alpha value . The alpha value is the percentage chance that you will reject the null (choose to go with your Ha research hypothesis as you conclusion) when in fact the Ho really true (and your research Ha should not be selected). This is also called a Type I error (choosing Ha when Ho is actually correct).
The smaller the alpha, the smaller the percentage of error, BUT the smaller the rejection regions and more difficult to reject Ho.
Most research uses alpha at .05, which creates only a 5% chance of Type I error. However, in cases such as medical research, the alpha is set much smaller.
In our case, we will use alpha = .05
This is TWOTAILED test, therefore the rejection regions are denoted by + or – 1.96.
HOW TO Find Critical Values and Rejection Regions
NOTE: From the ztable, the critical values for a twotailed ztest at alpha = .05 is +/ 1.96
Step 5: Create a conclusion
Our ztest result is 1.825
Because 1.825 < 1.96 it is NOT inside the rejection region.
Recall that the rejection regions for a two tailed test with alpha set to .05 is any value above 1.96 OR any value below – 1.96. Because 1.825 is not above 1.96 or below 1.96, it is NOT in the rejection region.
Therefore, this result is NOT significant. We CANNOT reject Ho. We CANNOT conclude that there is a significant difference between the funding for Michigan and the average funding for the USA.
http://www.ascd.org/publications/educationalleadership/may02/vol59/num08/UnequalSchoolFundingintheUnitedStates.aspx
Z Table. Z Score Table. Normal Distribution Table. Standard Normal Table.
What is ZTest?
ZTest is a statistical test which let’s us approximate the distribution of the test statistic under the null hypothesis using normal distribution .
ZTest is a test statistic commonly used in hypothesis test when the sample data is large.For carrying out the ZTest, population parameters such as mean, variance, and standard deviation should be known.
This test is widely used to determine whether the mean of the two samples are different when the variance is known. We make use of the Z score and the Z table for running the ZTest.
ZTest as Hypothesis Test
A test statistic is a random variable that we calculate from the sample data to determine whether to reject the null hypothesis. This random variable is used to calculate the Pvalue, which indicates how strong the evidence is against the null hypothesis. ZTest is such a test statistic where we make use of the mean value and z score to determine the Pvalue. ZTest compares the mean of two large samples taken from a population when the variance is known.
ZTest is usually used to conduct a hypothesis test when the sample size is greater than 30. This is because of the central limit theorem where when the sample gets larger, the distributed data graph starts resembling a bell curve and is considered to be distributed normally. Since the ZTest follows normal distribution under the null hypothesis, it is the most suitable test statistic for large sample data.
Why do we use a large sample for conducting a hypothesis test?
In a hypothesis test, we are trying to reject a null hypothesis with the evidence that we should collect from sample data which represents only a portion of the population. When the population has a large size, and the sample data is small, we will not be able to draw an accurate conclusion from the test to prove our null hypothesis is false. As sample data provide us a door to the entire population, it should be large enough for us to arrive at a significant inference. Hence a sufficiently large data should be considered for a hypothesis test especially if the population is huge.
How to Run a ZTest
ZTest can be considered as a test statistic for a hypothesis test to calculate the Pvalue. However, there are certain conditions that should be satisfied by the sample to run the ZTest.
The conditions are as follows:
 The sample size should be greater than 30.
This is already mentioned above. The size of the sample is an important factor in ZTesting as the ZTest follows a normal distribution and so should the data. If the same size is less than 30, it is recommended to use a ttest instead
 All the data point should be independent and doesn’t affect each other.
Each element in the sample, when considered single should be independent and shouldn’t have a relationship with another element.
 The data must be distributed normally.
This is ensured if the sample data is large.
 The sample should be selected randomly from a population.
Each data in the population should have an equal chance to be selected as one of the sample data.
 The sizes of the selected samples should be equal if at all possible.
When considering multiple sample data, ensuring that the size of each sample is the same for an accurate calculation of population parameters.
 The standard deviation of the population is known.
The population parameter, standard deviation must be given to run a ZTest as we cannot perform the calculation without knowing it. If it is not directly given, then it assumed that the variance of the sample data is equal to the variance of the entire population.
If the conditions are satisfied, the ZTest can be successfully implemented.
Following are steps to run the ZTest:
 State the null hypothesis
The null hypothesis is a statement of no effect and it supports the data which is already given. It is generally represented as :
 State the alternate hypothesis
The statement that we are trying to prove is the alternate hypothesis. It is represented as:
This is the representation of a bidirectional alternate hypothesis.
 H 1 :µ > k
This is the representation of a onedirectional alternate hypothesis that is represented in the right region of the graph.
 H 1 :µ < k
This is the representation of a onedirectional alternate hypothesis that is represented in the left region of the graph.
 Choose an alpha level for the test.
Alpha level or significant level is the probability of rejecting the null hypothesis when it is true. It is represented by ( α ). An alpha level must be chosen wisely so as to avoid the Type I and Type II errors.
If we choose a large alpha value such as 10%, it is likely to reject a null hypothesis when it is true. There is a probability of 10% for us to reject the null hypothesis. This is an error known as the Type I error.
On the other hand, if we choose an alpha level as low as 1%, there is a chance to accept the null hypothesis even if it is false. That is we reject the alternate hypothesis to favor the null hypothesis. This is the Type II error.
Hence the alpha level should be chosen in such a way that the chance of making Type I or Type II error is minimal. For this reason, the alpha level is commonly selected as 5% which is proven best to avoid errors.
 Determining the critical value of Z from the Z table.
The critical value is the point in the normal distribution graph that splits the graph into two regions: the acceptance region and the rejection regions. It can be also described as the extreme value for which a null hypothesis can be accepted. This critical value of Z can be found from the Z table .
 Calculate the test statistic.
The sample data that we choose to test is converted into a single value. This is known as the test statistic. This value is compared to the null value. If the test statistic significantly differs from the null value, the null value is rejected.
 Comparing the test statistic with the critical value.
Now, we have to determine whether the test statistic we have calculated comes under the acceptance region or the rejection region. For this, the test statistic is compared with the critical value to know whether we should accept or reject a null hypothesis.
Types of ZTest
ZTest can be used to run a hypothesis test for a single sample or to compare the mean of two samples. There are two common types of ZTest
OneSample ZTest
This is the most basic type of hypothesis test that is widely used. For running an onesample ZTest, all we need to know is the mean and standard deviation of the population. We consider only a single sample for a onesample ZTest. Onesample ZTest is used to test whether the population parameter is different from the hypothesized value i.e whether the mean of the population is equal to, less than or greater than the hypothesized value.
The equation for finding the value of Z is:
The following are the assumptions that are generally taken for a onesampled ZTest:
 The sample size is equal to or greater than 30.
 One normally distributed sample is considered with the standard deviation known.
 The null hypothesis is that the population mean that is calculated from the sample is equal to the hypothetically determined population mean.
TwoSample ZTest
A twosample ZTest is used whenever there is a comparison between two independent samples. It is used to check whether the difference between the means is equal to zero or not. Suppose if we want to know whether men or women prefer to drive more in a city, we use a twosample ZTest as it is the comparison of two independent samples of men and women.
 x 1 and x 2 represent the mean of the two samples.
 µ 1 and µ 2 are the hypothesized mean values.
 σ 1 and σ 2 are the standard deviations.
 n 1 and n 2 are the sizes of the samples.
The following are the assumptions that are generally taken for a twosample ZTest:
 Two independent, normally distributed samples are considered for the ZTest with the standard deviation known.
 Each sample is equal to or greater than 30.
 The null hypothesis is stated that the population mean of the two samples taken does not differ.
Critical value
A critical value is a line that splits a normally distributed graph into two different sections. Namely the ‘Rejection region’ and ‘Acceptance region’. If your test value falls in the ‘Rejection region’, then the null hypothesis is rejected and if your test value falls in the ‘Accepted region’, then the null hypothesis is accepted.
Critical Value Vs Significant Value
Significant level, alpha is the probability of rejecting a null hypothesis when it is actually true. While the critical value is the extreme value up to which a null hypothesis is true. There migh come a confusion regarding both of these parameters.
Critical value is a value that lies in critical region. It is in fact the boundary value of the rejection region. Also, it is the value up to which the null hypothesis is true. Hence the critical value is considered to be the point at which the null hypothesis is true or is rejected.
Critical value gives a point of extremity whose probability is indicated by the significant level. Significant level is preselected for a hypothesis test and critical value is calculated from this Alpha value. Critical value is a point represented as Z score and Significant level is a probability.
ZTest Vs TTest
ZTest are used when the sample size exceeds 30. As ZTest follows normal distribution, large sample size can be taken for the ZTest. ZTest indicates the distance of a data point from the mean of the data set in terms of standard deviation. Also. this test can only be used if the standard deviation of the data set is known.
TTest is based on T distribution in which the mean value is known and the variance could be calculated from the sample. TTest is most preferred to know the difference between the statistical parameters of two samples as the standard deviation of the samples are not usually given in a twosample test for running the ZTest. Also, if the sample size is less than 30, TTest is preferred.
 Search Search Please fill out this field.
What Is a ZTest?
Understanding ztests, the bottom line.
 Corporate Finance
 Financial Analysis
ZTest: Definition, Uses in Statistics, and Example
James Chen, CMT is an expert trader, investment adviser, and global market strategist.
Investopedia / Julie Bang
A ztest is a statistical test used to determine whether two population means are different when the variances are known and the sample size is large. It can also be used to compare one mean to a hypothesized value.
The data must approximately fit a normal distribution , otherwise the test doesn't work. Parameters such as variance and standard deviation should be calculated for a ztest to be performed.
Key Takeaways
 A ztest is a statistical test to determine whether two population means are different or to compare one mean to a hypothesized value when the variances are known and the sample size is large.
 A ztest is a hypothesis test for data that follows a normal distribution.
 A zstatistic, or zscore, is a number representing the result from the ztest.
 Ztests are closely related to ttests, but ttests are best performed when an experiment has a small sample size.
 Ztests assume the standard deviation is known, while ttests assume it is unknown.
The ztest is also a hypothesis test in which the zstatistic follows a normal distribution. The ztest is best used for greaterthan30 samples because, under the central limit theorem , as the number of samples gets larger, the samples are considered to be approximately normally distributed.
When conducting a ztest, the null and alternative hypotheses, and alpha level should be stated. The zscore , also called a test statistic, should be calculated, and the results and conclusion stated. A zstatistic, or zscore, is a number representing how many standard deviations above or below the mean population a score derived from a ztest is.
Examples of tests that can be conducted as ztests include a onesample location test, a twosample location test, a paired difference test, and a maximum likelihood estimate. Ztests are closely related to ttests, but ttests are best performed when an experiment has a small sample size. Also, ttests assume the standard deviation is unknown, while ztests 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 ZScore
The Zscore is calculated with the formula:
z = ( x  μ ) / σ
 z = Zscore
 x = the value being evaluated
 μ = the mean
 σ = the standard deviation
OneSample ZTest Example
Assume an investor wishes to test whether the average daily return of a stock is greater than 3%. A simple random sample of 50 returns is calculated and has an average of 2%. Assume the standard deviation of the returns is 2.5%. Therefore, the null hypothesis is when the average, or mean, is equal to 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 twotailed test . Consequently, there is 0.025% of the samples in each tail, and the alpha has a critical value of 1.96 or 1.96. If the value of 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 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 TTest and ZTest?
Ztests are closely related to ttests, but ttests are best performed when the data consists of a small sample size, i.e., less than 30. Also, ttests assume the standard deviation is unknown, while ztests assume it is known.
When Should You Use a ZTest?
If the standard deviation of the population is known and the sample size is greater than or equal to 30, the ztest can be used. Regardless of the sample size, if the population standard deviation is unknown, a ttest should be used instead.
What Is a ZScore?
A zscore, or zstatistic, is a number representing how many standard deviations above or below the mean population the score derived from a ztest is. Essentially, it is a numerical measurement that describes a value's relationship to the mean of a group of values. If a zscore is 0, it indicates that the data point's score is identical to the mean score. A zscore of 1.0 would indicate a value that is one standard deviation from the mean. Zscores may be positive or negative, with a positive value indicating the score is above the mean and a negative score indicating it is below the mean.
What Is Central Limit Theorem (CLT)?
In the study of probability theory, the central limit theorem (CLT) states that the distribution of sample approximates a normal distribution (also known as a “bell curve”) 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 ztest's fidelity relies on the CLT holding.
What Are the Assumptions of the ZTest?
For a ztest to be effective, the population must be normally distributed, and the samples must have the same variance. In addition, all data points should be independent of one another.
A ztest is used in hypothesis testing to evaluate whether a finding or association is statistically significant or not. In particular, it tests whether two means are the same (the null hypothesis). A ztest can only be used if the population standard deviation is known and the sample size is 30 data points or larger. Otherwise, a ttest should be employed.
Newcastle University. " ZTest ."
 Terms of Service
 Editorial Policy
 Privacy Policy
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.
 View all journals
 Explore content
 About the journal
 Publish with us
 Sign up for alerts
 Published: 29 August 2024
The genetic landscape of neurorelated proteins in human plasma
 Linda Repetto ORCID: orcid.org/0000000279014549 1 , 2 , 3 , 4 na1 ,
 Jiantao Chen ORCID: orcid.org/0000000272142257 1 , 2 , 5 na1 ,
 Zhijian Yang ORCID: orcid.org/0000000348038633 1 , 2 , 5 , 6 na1 ,
 Ranran Zhai ORCID: orcid.org/0000000258349120 1 , 2 , 5 , 6 na1 ,
 Paul R. H. J. Timmers ORCID: orcid.org/0000000251971267 3 , 7 ,
 Xiao Feng ORCID: orcid.org/0000000189196000 2 , 5 ,
 Ting Li ORCID: orcid.org/0000000296141566 1 , 2 , 5 ,
 Yue Yao 2 , 5 ,
 Denis Maslov ORCID: orcid.org/0000000328065933 8 ,
 Anna Timoshchuk ORCID: orcid.org/0000000185294498 8 ,
 Fengyu Tu ORCID: orcid.org/0000000187487250 1 ,
 Emma L. Twait 9 ,
 Sebastian MayWilson ORCID: orcid.org/0000000326685717 3 ,
 Marisa D. Muckian ORCID: orcid.org/0000000304193797 3 ,
 Bram P. Prins 10 ,
 Grace Png 11 , 12 ,
 Charles Kooperberg ORCID: orcid.org/0000000279868560 13 ,
 Åsa Johansson 14 ,
 Robert F. Hillary ORCID: orcid.org/000000022595552X 15 ,
 Eleanor Wheeler ORCID: orcid.org/0000000286166444 16 ,
 Lu Pan ORCID: orcid.org/0000000174676992 6 ,
 Yazhou He 17 ,
 Sofia Klasson 18 ,
 Shahzad Ahmad ORCID: orcid.org/0000000286583790 19 ,
 James E. Peters 20 ,
 Arthur Gilly 11 ,
 Maria Karaleftheri 21 ,
 Emmanouil Tsafantakis 22 ,
 Jeffrey Haessler 13 ,
 Ulf Gyllensten 14 ,
 Sarah E. Harris ORCID: orcid.org/0000000249415106 23 ,
 Nicholas J. Wareham ORCID: orcid.org/0000000314222993 16 ,
 Andreas Göteson ORCID: orcid.org/0000000161186054 24 ,
 Cecilia Lagging ORCID: orcid.org/0000000256922755 18 , 25 ,
 Mohammad Arfan Ikram ORCID: orcid.org/0000000303728585 19 ,
 Cornelia M. van Duijn ORCID: orcid.org/0000000223749204 19 ,
 Christina Jern 18 , 25 ,
 Mikael Landén ORCID: orcid.org/0000000244966451 6 , 24 ,
 Claudia Langenberg ORCID: orcid.org/0000000250177344 16 , 26 , 27 ,
 Ian J. Deary ORCID: orcid.org/000000021733263X 23 ,
 Riccardo E. Marioni ORCID: orcid.org/0000000344304260 15 ,
 Stefan Enroth 14 ,
 Alexander P. Reiner ORCID: orcid.org/0000000214274470 28 ,
 George Dedoussis 29 ,
 Eleftheria Zeggini 11 , 30 ,
 Sodbo Sharapov ORCID: orcid.org/0000000302794900 8 , 31 ,
 Yurii S. Aulchenko 8 , 32 ,
 Adam S. Butterworth ORCID: orcid.org/0000000269159015 10 , 33 , 34 , 35 , 36 , 37 ,
 Anders Mälarstig ORCID: orcid.org/0000000326081358 6 , 38 ,
 James F. Wilson ORCID: orcid.org/0000000157519178 3 , 7 na1 ,
 Pau Navarro ORCID: orcid.org/0000000155768584 3 , 7 na1 &
 Xia Shen ORCID: orcid.org/0000000343901979 1 , 2 , 3 , 5 , 6 na1
Nature Human Behaviour ( 2024 ) Cite this article
Metrics details
 Genetics research
 Genomewide association studies
Understanding the genetic basis of neurorelated proteins is essential for dissecting the molecular basis of human behavioural traits and the disease aetiology of neuropsychiatric disorders. Here the SCALLOP Consortium conducted a genomewide association metaanalysis of over 12,000 individuals for 184 neurorelated proteins in human plasma. The analysis identified 125 cis regulatory protein quantitative trait loci ( cis pQTL) and 164 trans pQTL. The mapped pQTL capture on average 50% of each protein’s heritability. At the cis pQTL, multiple proteins shared a genetic basis with human behavioural traits such as alcohol and food intake, smoking and educational attainment, as well as neurological conditions and psychiatric disorders such as pain, neuroticism and schizophrenia. Integrating with established drug information, the causal inference analysis validated 52 out of 66 matched combinations of protein targets and diseases or side effects with available drugs while suggesting hundreds of repurposing and new therapeutic targets.
This is a preview of subscription content, access via your institution
Access options
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our bestvalue onlineaccess subscription
24,99 € / 30 days
cancel any time
Subscribe to this journal
Receive 12 digital issues and online access to articles
111,21 € per year
only 9,27 € per issue
Buy this article
 Purchase on SpringerLink
 Instant access to full article PDF
Prices may be subject to local taxes which are calculated during checkout
Data availability
The full genomewide summary association statistics for the 184 proteins are publicly available at https://doi.org/10.7488/ds/7522 ; cis eQTL summarylevel data by eQTLGen, https://eqtlgen.org/ciseqtls.html ; GTEx data, https://gtexportal.org/home/datasets ; 1000 Genomes phase 3 genotype data, https://www.coggenomics.org/plink/2.0/resources#phase3_1kg ; Neale’s lab UK Biobank round 2 GWAS summarylevel data, http://www.nealelab.is/ukbiobank ; Psychiatric Genomics Consortium (PGC) summarylevel data, https://pgc.unc.edu/forresearchers/downloadresults/ ; DrugBank, https://www.drugbank.com ; and Drugs.com, https://www.drugs.com . Source data are provided with this paper.
Code availability
Software used included METAL ( https://genome.sph.umich.edu/wiki/METAL_Documentation ), PLINK ( https://www.coggenomics.org/plink/ ), GenABEL ( https://cran.rproject.org/src/contrib/Archive/GenABEL/ ), GCTAGSMR ( https://yanglab.westlake.edu.cn/software/gsmr/ ), PhenoScanner ( http://www.phenoscanner.medschl.cam.ac.uk ), MendelianRandomization ( https://cran.rproject.org/web/packages/MendelianRandomization/index.html ), coloc ( https://chr1swallace.github.io/coloc/index.html ), locuszoom ( http://locuszoom.org/ ) and FUMA ( https://fuma.ctglab.nl ).
Danaei, G. et al. The preventable causes of death in the United States: comparative risk assessment of dietary, lifestyle, and metabolic risk factors. PLoS Med. 6 , 1–23 (2009).
Article Google Scholar
Wang, X. et al. Fruit and vegetable consumption and mortality from all causes, cardiovascular disease, and cancer: systematic review and doseresponse metaanalysis of prospective cohort studies. BMJ https://www.bmj.com/content/349/bmj.g4490 (2014).
Mental Disorders (WHO, 2019); https://www.who.int/newsroom/factsheets/detail/mentaldisorders
Mental Health (Ritchie, H. & Roser, M., 2020); https://ourworldindata.org/mentalhealth
Hossain, M. M. et al. Epidemiology of mental health problems in COVID19: a review. F1000Research https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7549174/ (2020).
Greenberg, N. Mental health of healthcare workers in the COVID19 era. Nat. Rev. Nephrol. 16 , 425–426 (2020).
Article CAS PubMed PubMed Central Google Scholar
Jones, E. A., Mitra, A. K. & Bhuiyan, A. R. Impact of COVID19 on mental health in adolescents: a systematic review. Int. J. Environ. Res. Public Health 18 , 2470 (2021).
Bearden, C. E., Reus, V. I. & Freimer, N. B. Why genetic investigation of psychiatric disorders is so difficult. Curr. Opin. Genet. Dev. 14 , 280–286 (2004).
Article CAS PubMed Google Scholar
Sullivan, P. F. & Geschwind, D. H. Defining the genetic, genomic, cellular, and diagnostic architectures of psychiatric disorders. Cell 177 , 162–183 (2019).
Taylor, M. J. et al. Association of genetic risk factors for psychiatric disorders and traits of these disorders in a Swedish population twin sample. JAMA Psychiatry 76 , 280–289 (2019).
Article PubMed Google Scholar
Visscher, P. M., Brown, M. A., McCarthy, M. I. & Yang, J. Five years of GWAS discovery. Am. J. Hum. Genet. 90 , 7–24 (2012).
Visscher, P. M. et al. 10 years of GWAS discovery: biology, function, and translation. Am. J. Hum. Genet. 101 , 5–22 (2017).
Chames, P., Regenmortel, M. V., Weiss, E. & Baty, D. Therapeutic antibodies: successes, limitations and hopes for the future. Br. J. Pharmacol. 157 , 220–233 (2009).
Solomon, T. et al. Identification of common and rare genetic variation associated with plasma protein levels using whole exome sequencing and mass spectrometry. Circ. Genom. Precis. Med. 11 , e002170 (2018).
Folkersen, L. et al. Genomic and drug target evaluation of 90 cardiovascular proteins in 30,931 individuals. Nat. Metab. 2 , 1135–1148 (2020).
Westwood, S. et al. Plasma protein biomarkers for the prediction of CSF amyloid and tau and [18F]flutemetamol PET scan result. Front. Aging Neurosci. 10 , 409 (2018).
Dencker, M., Björgell, O. & Hlebowicz, J. Effect of food intake on 92 neurological biomarkers in plasma. Brain Behav. 7 , e00747 (2017).
Article PubMed PubMed Central Google Scholar
Jabbari, E. et al. Proximity extension assay testing reveals novel diagnostic biomarkers of atypical parkinsonian syndromes. J. Neurol. Neurosurg. Psychiatry 90 , 768–773 (2019).
Hillary, R. F. et al. Genome and epigenome wide studies of neurological protein biomarkers in the Lothian Birth Cohort 1936. Nat. Commun. 10 , 3160 (2019).
Harris, S. E. et al. Neurologyrelated protein biomarkers are associated with cognitive ability and brain volume in older age. Nat. Commun. 11 , 800 (2020).
RodriguesAmorim, D. et al. Plasma βIII tubulin, neurofilament light chain and glial fibrillary acidic protein are associated with neurodegeneration and progression in schizophrenia. Sci. Rep. 10 , 1–10 (2020).
Sandberg, J. V. et al. Proteins associated with future suicide attempts in bipolar disorder: a largescale biomarker discovery study. Mol. Psychiatry 27 , 3857–3863 (2022).
Folkersen, L. et al. Mapping of 79 loci for 83 plasma protein biomarkers in cardiovascular disease. PLoS Genet. 13 , e1006706 (2017).
Williams, S. A. et al. Plasma protein patterns as comprehensive indicators of health. Nat. Med. 25 , 1851–1857 (2019).
Lehallier, B. et al. Undulating changes in human plasma proteome profiles across the lifespan. Nat. Med. 25 , 1843–1850 (2019).
Wingo, A. P. et al. Integrating human brain proteomes with genomewide association data implicates new proteins in Alzheimer’s disease pathogenesis. Nat. Genet. 53 , 143–146 (2021).
Jensen, S. B. et al. Discovery of novel plasma biomarkers for future incident venous thromboembolism by untargeted synchronous precursor selection mass spectrometry proteomics. J. Thromb. Haemost. 16 , 1763 (2018).
Sun, B. B. et al. Genomic atlas of the human plasma proteome. Nature 558 , 73–79 (2018).
Assarsson, E. et al. Homogenous 96plex pea immunoassay exhibiting high sensitivity, specificity, and excellent scalability. PLoS ONE 9 , e95192 (2014).
Võsa, U. et al. Largescale cis  and trans eQTL analyses identify thousands of genetic loci and polygenic scores that regulate blood gene expression. Nat. Genet. 53 , 1300–1310 (2021).
Ferkingstad, E. et al. Largescale integration of the plasma proteome with genetics and disease. Nat. Genet. 53 , 1712–1721 (2021).
BulikSullivan, B. et al. LD score regression distinguishes confounding from polygenicity in genomewide association studies. Nat. Genet. 47 , 291–295 (2015).
BulikSullivan, B. et al. An atlas of genetic correlations across human diseases and traits. Nat. Genet. 47 , 1236–1241 (2015).
Ning, Z., Pawitan, Y. & Shen, X. Highdefinition likelihood inference of genetic correlations across human complex traits. Nat. Genet. 52 , 859–864 (2020).
Aulchenko, Y. S., Ripke, S., Isaacs, A. & van Duijn, C. M. GenABEL: an R library for genomewide association analysis. Bioinformatics 23 , 1294–1296 (2007).
Staley, J. R. et al. PhenoScanner: a database of human genotype–phenotype associations. Bioinformatics 32 , 3207–3209 (2016).
Kamat, M. A. et al. PhenoScanner v2: an expanded tool for searching human genotype–phenotype associations. Bioinformatics 35 , 4851–4853 (2019).
Png, G. et al. Mapping the serum proteome to neurological diseases using whole genome sequencing. Nat. Commun. 12 , 7042 (2021).
Sun, B. B. et al. Plasma proteomic associations with genetics and health in the UK Biobank. Nature 622 , 329–338 (2023).
Giambartolomei, C. et al. Bayesian test for colocalisation between pairs of genetic association studies using summary statistics. PLoS Genet. 10 , e1004383 (2014).
Wang, G., Sarkar, A., Carbonetto, P. & Stephens, M. A simple new approach to variable selection in regression, with application to genetic fine mapping. J. R. Stat. Soc. Series B Stat. Methodol. 82 , 1273–1300 (2020).
Wallace, C. A more accurate method for colocalisation analysis allowing for multiple causal variants. PLoS Genet. 17 , e1009440 (2021).
Wightman, D. P. et al. A genomewide association study with 1,126,563 individuals identifies new risk loci for Alzheimer’s disease. Nat. Genet. 53 , 1276–1282 (2021).
Zhu, Z. et al. Causal associations between risk factors and common diseases inferred from GWAS summary data. Nat. Commun. 9 , 224 (2018).
Bretherick, A. D. et al. Linking protein to phenotype with Mendelian randomization detects 38 proteins with causal roles in human diseases and traits. PLoS Genet. 16 , e1008785 (2020).
Molica, M. et al. Cd33 expression and gentuzumab ozogamicin in acute myeloid leukemia: two sides of the same coin. Cancers https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8268215/ (2021).
Tomoda, F., Nitta, A., Sugimori, H., Koike, T. & Kinugawa, K. Plasma and urinary levels of nerve growth factor are elevated in primary hypertension. Int. J. Hypertens. 2022 , 3003269 (2022).
Knardahl, S. Cardiovascular psychophysiology. Ann. Med. 32 , 329–335 (2000).
Ioannidis, K., Askelund, A. D., Kievit, R. A. & Harmelen, A. L. V. The complex neurobiology of resilient functioning after childhood maltreatment. BMC Med. 18 , 1–16 (2020).
Google Scholar
McLaughlin, K. A., Colich, N. L., Rodman, A. M. & Weissman, D. G. Mechanisms linking childhood trauma exposure and psychopathology: a transdiagnostic model of risk and resilience. BMC Med. 18 , 1–11 (2020).
Fried, E. I. & Robinaugh, D. J. Systems all the way down: embracing complexity in mental health research. BMC Med. 18 , 1–4 (2020).
Fleshner, M., Frank, M. & Maier, S. F. Danger signals and inflammasomes: stressevoked sterile inflammation in mood disorders. Neuropsychopharmacology 42 , 36–45 (2016).
Bauer, M. E. & Teixeira, A. L. Inflammation in psychiatric disorders: what comes first? Ann. N. Y. Acad. Sci. 1437 , 57–67 (2019).
Liu, Y.L. et al. TM6SF2 rs58542926 influences hepatic fibrosis progression in patients with nonalcoholic fatty liver disease. Nat. Commun. 5 , 4309 (2014).
Burgess, S., Foley, C. N., Allara, E., Staley, J. R. & Howson, J. M. A robust and efficient method for Mendelian randomization with hundreds of genetic variants. Nat. Commun. 11 , 376 (2020).
Slob, E. A. & Burgess, S. A comparison of robust Mendelian randomization methods using summary data. Genet. Epidemiol. 44 , 313–329 (2020).
Smith, G. D. & Ebrahim, S. Mendelian randomization: prospects, potentials, and limitations. Int. J. Epidemiol. 33 , 30–42 (2004).
Gill, D. et al. Mendelian randomization for studying the effects of perturbing drug targets. Wellcome Open Res. 6 , 24 (2021).
Sanderson, E. et al. Mendelian randomization. Nat. Rev. Methods Primers 2 , 1–21 (2022).
Heurich, M., Föcking, M., Mongan, D., Cagney, G. & Cotter, D. R. Dysregulation of complement and coagulation pathways: emerging mechanisms in the development of psychosis. Mol. Psychiatry 27 , 127–140 (2022).
Yang, Y. et al. Altered levels of acute phase proteins in the plasma of patients with schizophrenia. Anal. Chem. 78 , 3571–3576 (2006).
Levin, Y. et al. Global proteomic profiling reveals altered proteomic signature in schizophrenia serum. Mol. Psychiatry 15 , 1088–1100 (2010).
Baumeister, D., Akhtar, R., Ciufolini, S., Pariante, C. M. & Mondelli, V. Childhood trauma and adulthood inflammation: a metaanalysis of peripheral Creactive protein, interleukin6 and tumour necrosis factorα. Mol. Psychiatry 21 , 642–649 (2016).
Varatharaj, A. & Galea, I. The blood–brain barrier in systemic inflammation. Brain Behav. Immun. 60 , 1–12 (2017).
Najjar, S. et al. Neurovascular unit dysfunction and blood–brain barrier hyperpermeability contribute to schizophrenia neurobiology: a theoretical integration of clinical and experimental evidence. Front. Psychiatry https://pubmed.ncbi.nlm.nih.gov/28588507/ (2017).
Sharapov, S. Z. et al. Defining the genetic control of human blood plasma Nglycome using genomewide association study. Hum. Mol. Genet. 28 , 2062 (2019).
CAS PubMed PubMed Central Google Scholar
Sharapov, S. Z. et al. Replication of 15 loci involved in human plasma protein N glycosylation in 4802 samples from four cohorts. Glycobiology 31 , 82 (2021).
Shen, X. et al. Multivariate discovery and replication of five novel loci associated with immunoglobulin G N glycosylation. Nat. Commun. http://www.research.ed.ac.uk/portal/files/43181419/Multivariate_discovery_and_replication_of_five_novel_loci_associated_with_Immunoglobulin_G_N_glycosylation.pdf (2017).
Zhao, J. H. et al. Genetics of circulating inflammatory proteins identifies drivers of immunemediated disease risk and therapeutic targets. Nat. Immunol. 24 , 1540–1551 (2023).
Yang, C. et al. Genomic atlas of the proteome from brain, CSF and plasma prioritizes proteins implicated in neurological disorders. Nat. Neurosci. 24 , 1302–1312 (2021).
Willer, C. J., Li, Y. & Abecasis, G. R. METAL: fast and efficient metaanalysis of genomewide association scans. Bioinformatics 26 , 2190 (2010).
Watanabe, K., Taskesen, E., Bochoven, A. V. & Posthuma, D. Functional mapping and annotation of genetic associations with FUMA. Nat. Commun. 8 , 1826 (2017).
Watanabe, K., Taskesen, E., van Bochoven, A. & Posthuma, D. FUMA: functional mapping and annotation of genetic associations. Eur. Neuropsychopharmacol. 29 , S789–S790 (2019).
Pruim, R. J. et al. LocusZoom: regional visualization of genomewide association scan results. Bioinformatics 26 , 2336 (2010).
Boughton, A. P. et al. LocusZoom.js: interactive and embeddable visualization of genetic association study results. Bioinformatics 37 , 3017–3018 (2021).
Pirinen, M., Donnelly, P. & Spencer, C. C. A. Efficient computation with a linear mixed model on largescale data sets with applications to genetic studies. Ann. Appl. Stat. 7 , 369–390 (2013).
Download references
Acknowledgements
X.S. was in receipt of a National Key Research and Development Program grant (numbers 2022YFF1202100 and 2022YFF1202105), a National Natural Science Foundation of China (NSFC) grant (number 12171495), a Natural Science Foundation of Guangdong Province grant (number 2021A1515010866) and Swedish Research Council (Vetenskapsrådet) grants (numbers 201702543 and 202201309). P.R.H.J.T. and J.F.W. acknowledge support from the Medical Research Council Human Genetics Unit Program grant ‘Quantitative Traits in Health and Disease’ (U. MC_UU_00007/10). The work of D.M., A.T., S.S. and Y.S.A. was supported by the Research Program at the Moscow State University (MSU) Institute for Artificial Intelligence. The work from X.F. was supported by the China Postdoctoral Science Foundation (number 2023M740690 and 2024T170174). The work from T.L. was supported by the China Postdoctoral Science Foundation (number 2023M740696). The work from C.K. and A.P.R. was supported in part by NIH grant R01HL136574. The funders had no role in study design, data collection and analysis, decision to publish or preparation of the paper. We thank the members of the SCALLOP Consortium of genomewide association studies for making their data available. Cohortspecific acknowledgements are given in Supplementary Information .
Author information
These authors contributed equally: Linda Repetto, Jiantao Chen, Zhijian Yang, Ranran Zhai, James F. Wilson, Pau Navarro, Xia Shen.
Authors and Affiliations
Biostatistics Group, School of Life Sciences, Sun Yatsen University, Guangzhou, China
Linda Repetto, Jiantao Chen, Zhijian Yang, Ranran Zhai, Ting Li, Fengyu Tu & Xia Shen
Center for Intelligent Medicine Research, Greater Bay Area Institute of Precision Medicine (Guangzhou), Fudan University, Guangzhou, China
Linda Repetto, Jiantao Chen, Zhijian Yang, Ranran Zhai, Xiao Feng, Ting Li, Yue Yao & Xia Shen
Centre for Global Health Research, Usher Institute, University of Edinburgh, Edinburgh, UK
Linda Repetto, Paul R. H. J. Timmers, Sebastian MayWilson, Marisa D. Muckian, James F. Wilson, Pau Navarro & Xia Shen
Health Data Science Centre, Fondazione Human Technopole, Milan, Italy
Linda Repetto
State Key Laboratory of Genetic Engineering, Center for Evolutionary Biology, School of Life Sciences, Fudan University, Shanghai, China
Jiantao Chen, Zhijian Yang, Ranran Zhai, Xiao Feng, Ting Li, Yue Yao & Xia Shen
Department of Medical Epidemiology and Biostatistics, Karolinska Institutet, Stockholm, Sweden
Zhijian Yang, Ranran Zhai, Lu Pan, Mikael Landén, Anders Mälarstig & Xia Shen
MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Edinburgh, UK
Paul R. H. J. Timmers, James F. Wilson & Pau Navarro
MSU Institute for Artificial Intelligence, Lomonosov Moscow State University, Moscow, Russia
Denis Maslov, Anna Timoshchuk, Sodbo Sharapov & Yurii S. Aulchenko
Julius Center for Health Sciences and Primary Care, University Medical Center Utrecht and Utrecht University, Utrecht, Netherlands
Emma L. Twait
BHF Cardiovascular Epidemiology Unit, Department of Public Health and Primary Care, University of Cambridge, Cambridge, UK
Bram P. Prins & Adam S. Butterworth
Institute of Translational Genomics, Helmholtz Zentrum München—German Research Center for Environmental Health, Neuherberg, Germany
Grace Png, Arthur Gilly & Eleftheria Zeggini
Technical University of Munich (TUM), TUM School of Medicine and Health, Munich, Germany
Division of Public Health Sciences, Fred Hutchinson Cancer Center, Seattle, WA, USA
Charles Kooperberg & Jeffrey Haessler
Department of Immunology, Genetics and Pathology, Science for Life Laboratory, Uppsala University, Uppsala, Sweden
Åsa Johansson, Ulf Gyllensten & Stefan Enroth
Centre for Genomic and Experimental Medicine, Institute of Genetics and Cancer, The University of Edinburgh, Edinburgh, UK
Robert F. Hillary & Riccardo E. Marioni
MRC Epidemiology Unit, Institute of Metabolic Science, University of Cambridge School of Clinical Medicine, Cambridge, UK
Eleanor Wheeler, Nicholas J. Wareham & Claudia Langenberg
Department of Epidemiology and Medical Statistics, Division of Oncology, West China School of Public Health and West China Fourth Hospital, Sichuan University, Chengdu, China
Institute of Biomedicine, Department of Laboratory Medicine, the Sahlgrenska Academy, University of Gothenburg, Gothenburg, Sweden
Sofia Klasson, Cecilia Lagging & Christina Jern
Department of Epidemiology, Erasmus MC, Rotterdam, The Netherlands
Shahzad Ahmad, Mohammad Arfan Ikram & Cornelia M. van Duijn
Department of Immunology and Inflammation, Faculty of Medicine, Imperial College London, London, UK
James E. Peters
Echinos Medical Centre, Echinos, Greece
Maria Karaleftheri
Anogia Medical Centre, Anogia, Greece
Emmanouil Tsafantakis
Lothian Birth Cohorts, University of Edinburgh, Edinburgh, UK
Sarah E. Harris & Ian J. Deary
Department of Psychiatry and Neurochemistry, Institute of Neuroscience and Physiology, The Sahlgrenska Academy at the University of Gothenburg, Gothenburg, Sweden
Andreas Göteson & Mikael Landén
Department of Clinical Genetics and Genomics, Region Västra Götaland, Sahlgrenska University Hospital, Gothenburg, Sweden
Cecilia Lagging & Christina Jern
Computational Medicine, Berlin Institute of Health (BIH) at Charité—Universitätsmedizin Berlin, Berlin, Germany
Claudia Langenberg
Precision Healthcare University Research Institute, Queen Mary University of London, London, UK
Division of Public Health Sciences, Fred Hutchinson Cancer Center and Department of Epidemiology, University of Washington, Seattle, WA, USA
Alexander P. Reiner
Department of Nutrition and Dietetics, School of Health Science and Education, Harokopio University of Athens, Athens, Greece
George Dedoussis
Technical University of Munich (TUM) and Klinikum Rechts der Isar, TUM School of Medicine and Health, Munich, Germany
Eleftheria Zeggini
Biostatistics Unit—Population and Medical Genomics Programme, Genomics Research Centre, Fondazione Human Technopole, Milan, Italy
Sodbo Sharapov
Institute of Cytology and Genetics SB RAS, Novosibirsk, Russia
Yurii S. Aulchenko
British Heart Foundation Centre of Research Excellence, University of Cambridge, Cambridge, UK
Adam S. Butterworth
Health Data Research UK Cambridge, Wellcome Genome Campus and University of Cambridge, Cambridge, UK
National Institute for Health Research Blood and Transplant Research Unit in Donor Health and Behaviour, University of Cambridge, Cambridge, UK
National Institute for Health Research Cambridge Biomedical Research Centre, University of Cambridge and Cambridge University Hospitals, Cambridge, UK
Victor Phillip Dahdaleh Heart and Lung Research Institute, University of Cambridge, Cambridge, UK
Emerging Science and Innovation, Pfizer Worldwide Research, Development and Medical, Cambridge, UK
Anders Mälarstig
You can also search for this author in PubMed Google Scholar
Contributions
X.S., P.N. and J.F.W. initiated and coordinated the study. L.R. performed the GWAS metaanalysis. J.C. conducted the colocalization analysis. Z.Y. conducted the Mendelian randomization analysis. R.Z. performed the drug target investigations. P.R.H.J.T., X.F., T.L., F.T., E.L.T., P.N. and X.S. contributed to the analysis pipeline. Y.Y. contributed to the crossreferencing prediction analysis. D.M. and A.T. contributed to the colocalization data processing and analysis. S.S. and Y.S.A. were involved in planning and supervising the work of D.M. and A.T. S.M.W., M.D.M., B.P.P., A.J., R.F.H., E.W., S.K., S.A., L.P., Y.H., G.P., C.K., J.E.P., U.G., S.E.H., N.J.W., C. Lagging, M.A.I., A. Gilly, A. Göteson, M.K., E.T., J.H., A.P.R., G.D., E.Z., M.L., C.M.V.D., C.J., C. Langenberg, I.J.D., R.E.M., S.E., A.S.B. and A.M. contributed to the cohortlevel analysis. L.R., J.C., Z.Y., R.Z., P.N. and X.S. wrote the paper. All authors approved the submitted version of the paper.
Corresponding author
Correspondence to Xia Shen .
Ethics declarations
Competing interests.
P.R.H.J.T. is a salaried employee of BioAge Labs, Inc. R.E.M. has received a speaker fee from Illumina, is an advisor to the Epigenetic Clock Development Foundation and is a scientific consultant for Optima Partners. E.W. is now an employee of AstraZeneca. Y.S.A. is now an employee of GSK. A.S.B. has received grants from AstraZeneca, Bayer, Biogen, BioMarin and Sanofi. A.M. is an employee of Pfizer. X.S. is the founder of Quantix BioSciences and has received a speaker fee from Olink Proteomics. The remaining authors declare no competing interests.
Peer review
Peer review information.
Nature Human Behaviour thanks Michael Johnson and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Peer reviewer reports are available.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Supplementary information.
IRBs/Ethics Statement, cohortspecific acknowledgements, analysis plan for the GWAS metaanalysis, Supplementary tables descriptions 1–30 and Figs. 1–11.
Reporting Summary
Peer review file, supplementary tables 1–30.
The content of these tables is described in the Supplementary Information file.
Source data
Source data fig. 1.
Statistical source data.
Source Data Fig. 2
Source data fig. 3, source data fig. 4, source data fig. 5, source data fig. 6, rights and permissions.
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author selfarchiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
Reprints and permissions
About this article
Cite this article.
Repetto, L., Chen, J., Yang, Z. et al. The genetic landscape of neurorelated proteins in human plasma. Nat Hum Behav (2024). https://doi.org/10.1038/s4156202401963z
Download citation
Received : 21 March 2023
Accepted : 22 July 2024
Published : 29 August 2024
DOI : https://doi.org/10.1038/s4156202401963z
Share this article
Anyone you share the following link with will be able to read this content:
Sorry, a shareable link is not currently available for this article.
Provided by the Springer Nature SharedIt contentsharing initiative
Quick links
 Explore articles by subject
 Guide to authors
 Editorial policies
Sign up for the Nature Briefing: Translational Research newsletter — top stories in biotechnology, drug discovery and pharma.
IMAGES
VIDEO
COMMENTS
Related posts: Null Hypothesis: Definition, Rejecting & Examples and Understanding Significance Levels. TwoSample Z Test Hypotheses. Null hypothesis (H 0): Two population means are equal (µ 1 = µ 2).; Alternative hypothesis (H A): Two population means are not equal (µ 1 ≠ µ 2).; Again, when the pvalue is less than or equal to your significance level, reject the null hypothesis.
Choose the alternative hypothesis: twotailed or left/righttailed. In our Ztest calculator, you can decide whether to use the pvalue or critical regions approach. In the latter case, set the significance level, α. \alpha α. Enter the value of the test statistic, z. z z.
The z test formula compares the z statistic with the z critical value to test whether there is a difference in the means of two populations. In hypothesis testing, the z critical value divides the distribution graph into the acceptance and the rejection regions.If the test statistic falls in the rejection region then the null hypothesis can be rejected otherwise it cannot be rejected.
How to perform a Z test when T is a statistic that is approximately normally distributed under the null hypothesis is as follows: . First, estimate the expected value μ of T under the null hypothesis, and obtain an estimate s of the standard deviation of T.. Second, determine the properties of T : one tailed or two tailed.. For Null hypothesis H 0: μ≥μ 0 vs alternative hypothesis H 1: μ ...
The ztest is a hypothesis test to determine if a single observed mean is signi cantly di erent (or greater or less than) the mean under the null hypothesis, hypwhen you know the standard deviation of the population. Here's where the ztest sits on our ow chart. Test for = 0 Ch 17.2 Test for 1 = 2 Ch 17.4 2 test frequency Ch 19.5
The zscore associated with a 5% alpha level / 2 is 1.96.. Step 5: Compare the calculated zscore from Step 3 with the table zscore from Step 4. If the calculated zscore is larger, you can reject the null hypothesis. 8.99 > 1.96, so we can reject the null hypothesis.. Example 2: Suppose that in a survey of 700 women and 700 men, 35% of women and 30% of men indicated that they support a ...
Based on the alternative hypothesis set for a study, a onesided ztest can be either a leftsided ztest or a rightsided ztest. For instance, if our H 0 : µ 0 = µ and H a : µ < µ 0 , such a test would be a onesided test or more precisely, a lefttailed test and there is one rejection area only on the left tail of the distribution.
A Ztest is a type of statistical hypothesis test where the teststatistic follows a normal distribution. The name Ztest comes from the Zscore of the normal distribution. This is a measure of how many standard deviations away a raw score or sample statistics is from the populations' mean. Ztests are the most common statistical tests ...
The formula to perform a one sample ztest. The assumptions of a one sample ztest. An example of how to perform a one sample ztest. Let's jump in! One Sample ZTest: Formula. A one sample ztest will always use one of the following null and alternative hypotheses: 1. TwoTailed ZTest. H 0: μ = μ 0 (population mean is equal to some ...
An example of how to perform a two sample ztest. Let's jump in! Two Sample ZTest: Formula. A two sample ztest uses the following null and alternative hypotheses: H 0: μ 1 = μ 2 (the two population means are equal) H A: μ 1 ≠ μ 2 (the two population means are not equal) We use the following formula to calculate the z test statistic: z ...
ZTest Formula. The Ztest compares the difference between the sample mean and the population means by considering the standard deviation of the sampling distribution. ... Now compare with the hypothesis and decide whether to reject or not reject the null hypothesis; Type of Ztest Lefttailed Test. In this test, our region of rejection is ...
If the pvalue that corresponds to the z test statistic is less than your chosen significance level (common choices are 0.10, 0.05, and 0.01) then you can reject the null hypothesis. One Sample ZTest: Assumptions. For the results of a one sample ztest to be valid, the following assumptions should be met: The data are continuous (not discrete ...
ZTest Formula. The ztest formula is as follows: Z = (x̅  μ0) / (σ /√n) Here, x̅ is the sample mean; μ0 is the population mean; σ is the standard deviation; n is the sample size. Based on the Ztest result, the research derives the hypothesis conclusion. It can either be a null or an alternative.
The calculator returns the ztest statistic and the pvalue. TI89: Go to the [Apps] Stat/List Editor, then press [2 nd] then F6 [Tests], then select 6: 2PropZTest. Type in the x 1, n 1, x 2, and n2 arrow over to the ≠ ≠, <, > and select the sign that is the same in the problem's alternative hypothesis statement.
Ztest. A Ztest is a type of statistical hypothesis test used to test the mean of a normally distributed test statistic. It tests whether there is a significant difference between an observed population mean and the population mean under the null hypothesis, H 0.. A Ztest can only be used when the population variance is known (or can be estimated with a high degree of accuracy), or if the ...
The pvalue for one sample ztest for proportion is calculated using the Z statistic. When conducting one proportion ztest, if the pvalue is less than the significance level, we can reject the null hypothesis. Otherwise, we fail to reject it. A one proportion ztest can be used to answer the following questions:
Use the ztest and the correct Ho and Ha to run a hypothesis test to determine if Michigan receives a significantly different amount of funding for public school education (per student per year). NOTE: This entire example works the same way if you have a dataset. Using the dataset, you would need to first calculate the sample mean.
Approximate Hypothesis Tests: the z Test and the t Test . This chapter presents two common tests of the hypothesis that a population mean equals a particular value and of the hypothesis that two population means are equal: the z test and the t test. These tests are approximate: They are based on approximations to the probability distribution of the test statistic when the null hypothesis is ...
What is ZTest?. ZTest is a statistical test which let's us approximate the distribution of the test statistic under the null hypothesis using normal distribution.. ZTest is a test statistic commonly used in hypothesis test when the sample data is large.For carrying out the ZTest, population parameters such as mean, variance, and standard deviation should be known.
ZTest: A ztest is a statistical test used to determine whether two population means are different when the variances are known and the sample size is large. The test statistic is assumed to have ...
Ztests are statistical hypothesis testing techniques that are used to determine whether the null hypothesis relating to comparing sample means or proportions with that of population at a given significance level can be rejected or otherwise based on the zstatistics or zscore. As a data scientist, you must get a good understanding of the z ...
What is ZTest? Ztest is a statistical hypothesis testing technique which is used to test the null hypothesis in relation to the following given that the population's standard deviation is known and the data belongs to normal distribution:. Use Ztest: To test whether there is a difference between sample and population Ztest can be used to test the hypothesis that there is a difference ...
Steps to run a zTest: Step1: State Your Hypotheses: Null Hypothesis (𝐻0): Aleternative Hypothesis (𝐻𝑎). Step 2: Specify a Significance Level (alpha). What is alpha α: The significance ...
We used the Bayesian colocalization analysis tool coloc with the posterior probabilities testing the H4 colocalization hypothesis for two models: (1) testing for a single shared causal variant ...