Z-Test: A Z test is a statistical hypothesis test which is best used when the population is normally distributed with known variance and population size greater than 30. As per central limit theorem as the sample size grows and number of data points get more than 30, the samples are considered to be normally distributed. Because of this whenever sample size gets bigger than 30, we assume data is normally distributed and we can use Z-test.
Z-test can be used primarily in two cases:
- Test the significance of a single mean
- Test the significance of difference between two means
Z-Score: Simply put, a Z-score tells us how many standard deviations a given data point is away from the mean of the distribution. Since Z-Score follows normal distribution so data has to be identically distributed above and below the mean. The 3 standard deviations above and below the mean covers almost 99.7% of the total area under the bell shape curve.
Z-Statistics = (X – μ) /σ
X = Sample Mean
μ= hypothesized population mean
σ = Standard Deviation
Z Test for Single Mean:
While defining hypothesis for a single mean, we can either state it as one tail Z-test or two tails Z-test.
The null hypothesis statement will be same in either case i.e. the population mean μ is equal to a given value μ0.
H0: μ = μ0
We can choose one of the possible alternative hypotheses statements:
- Ha : μ > μ0
- Ha: μ < μ0
- Ha: μ ≠ μ0
Z Test to test the significance of difference between two means: A z-test can be used to determine whether two population means are different when the variances are known and the sample size is large.
Null Hypothesis while testing significance difference between two means can be stated as follows:
H 0: μ 1 = μ 2
H a: μ 1 ≠ μ 2
Steps to follow while performing Z-Test:
- Data should be normally distributed, if sample size more than 30 central limit theorem takes care of normality
- Decide which Z-test to be used. A Single mean or Two mean Z test
- State null hypothesis and alternative hypothesis for the chosen Z-test
- Choose the level of significance against which we want to test hypothesis
- Calculate the Z- statistics
- Compare the Z-Statistics against critical value from Z-table and decide if you should support or reject the null hypothesis