How to Use and Create a Z-Table (Standard Normal Table) | by Michael Galarnyk | Towards Data Science

To be able to utilize a z-table and answer these questions, you have to turn the scores on the different tests into a standard normal distribution N(mean = 0, std = 1). Since these scores on these tests have a normal distribution, we can convert both of them into standard normal distributions by using the following formula.
With this formula, you can calculate z-scores for Zoe and Mike.
Since Zoe has a higher z-score than Mike, Zoe performed better on her test.
While we know that Zoe performed better, a z-table can tell you in what percentile the test takers are in. The following parital z-table (I cut it off so it wouldn’t take up too much space) can tell you the area underneath the curve to the left of our z-score. This is the probability.
Zoe (z-score = 1.25)
To use the z-score table, start on the left side of the table go down to 1.2. At the top of the table, go to 0.05 (this corresponds to the value of 1.2 + .05 = 1.25). The value in the table is .8944 which is the probability. Roughly 89.44% of people scored worse than her on the ACT.
Mike (z-score = 1.0)
To use the z-score table, start on the left side of the table go down to 1.0 and now at the top of the table, go to 0.00 (this corresponds to the value of 1.0 + .00 = 1.00). The value in the table is .8413 which is the probability. Roughly 84.13% of people scored worse than him on the SAT.
It is important to keep in mind that if you have a negative z-score, you can simply use a table that contains negative z-scores.
This section will answer where the values in the z table come from by going through the process of creating a z-score table. Please do not worry if you do not understand this section, it is not important if you just want to know how to use a z-score table.
This part of the post is very similar to the 68–95–99.7 rule article, but adapted for creating a z table. To be able to understand where the values come from, it is important to know about the probability density function (PDF). A PDF is used to specify the probability of the random variable falling within a particular range of values, as opposed to taking on any one value. This probability is given by the integral of this variable’s PDF over that range — that is, it is given by the area under the density function but above the horizontal axis and between the lowest and greatest values of the range. This definition might not make much sense so let’s clear it up by graphing the probability density function for a normal distribution. The equation below is the probability density function for a normal distribution
Let’s simplify it by assuming we have a mean (μ) of 0 and a standard deviation (σ) of 1 (standard normal distribution).
This can be graphed using anything, but I choose to graph it using Python.
# Import all libraries for this portion of the blog postfrom scipy.integrate import quadimport numpy as npimport matplotlib.pyplot as pltimport pandas as pd%matplotlib inlinex = np.linspace(-4, 4, num = 100)constant = 1.0 / np.sqrt(2*np.pi)pdf_normal_distribution = constant * np.exp((-x**2) / 2.0)fig, ax = plt.subplots(figsize=(10, 5));ax.plot(x, pdf_normal_distribution);ax.set_ylim(0);ax.set_title('Normal Distribution', size = 20);ax.set_ylabel('Probability Density', size = 20);
The graph above does not show you the probability of events but their probability density. To get the probability of an event within a given range you need to integrate.
Recall that the standard normal table entries are the area under the standard normal curve to the left of z (between negative infinity and z).
To find the area, you need to integrate. Integrating the PDF, gives you the cumulative distribution function (CDF) which is a function that maps values to their percentile rank in a distribution. The values in the table are calculated using the cumulative distribution function of a standard normal distribution with a mean of zero and a standard deviation of one. This can be denoted with the equation below.
This is not an easy integral to calculate by hand so I am going to use Python to calculate it. The code below calculates the probability for Zoe who had a z-score of 1.25 and Mike who had a z-score of 1.00.
def normalProbabilityDensity(x):    constant = 1.0 / np.sqrt(2*np.pi)    return(constant * np.exp((-x**2) / 2.0) )zoe_percentile, _ = quad(normalProbabilityDensity, np.NINF, 1.25)mike_percentile, _ = quad(normalProbabilityDensity, np.NINF, 1.00)print('Zoe: ', zoe_percentile)print('Mike: ', mike_percentile)
As the code below shows, these calculations can be done to create a z table.
One important point to emphasize is that calculating this table from scratch when needed is inefficient so we usually resort to using a standard normal table from a textbook or online source.
I hope you enjoyed this tutorial. The code used in this tutorial is located on my github. If you any questions or thoughts on the tutorial, feel free to reach out in the comments below or through Twitter. If you want to learn how to utilize the Pandas, Matplotlib, or Seaborn libraries, please consider taking my Python for Data Visualization LinkedIn Learning course.