5.3: Frequency Tables and Histograms
- Page ID
- 203110
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Displaying Qualitative Data
Categorical, or qualitative, data are pieces of information that allow us to classify the objects under investigation into various categories. We usually begin working with categorical data by summarizing the data into a frequency table.
A frequency table is a table that shows how often each value or category appears in a data set. It organizes data by listing the values (or groups of values) and the number of times each one occurs, making the data easier to read, analyze, and interpret.
If the data we’re visualizing is categorical, then we want a quick way to represent graphically the relative numbers of units that fall in each category. When we created the frequency distributions in the last section, all we did was count the number of units in each category and record that number (this was the frequency of that category). Frequencies are nice when we’re organizing and summarizing data; they’re easy to compute, and they’re always whole numbers. But they can be difficult to understand for an outsider who’s being introduced to your data.
Cumulative frequency is the running total of frequencies as you move through a data set from smallest to largest.
Cumulative Frequency is the sum of all frequencies up to that point.
Let’s consider a quick example. Suppose you surveyed some people and asked for their favorite color. You communicated your results using a frequency distribution. Jerry is interested in data on favorite colors, so he reads your frequency distribution. The first row indicates that twelve people listed green as their favorite color. However, Jerry has no way of knowing if that’s a lot of people without knowing how many people took your survey in total. Twelve is a pretty significant number if only twenty-five people took the survey, but it’s next to nothing if you recorded a thousand responses. For that reason, we will often summarize categorical data not with frequencies, but with proportions. The proportion of data that falls into a particular category is computed by dividing the frequency for that category by the total number of units in the data.
\[\text{Relative Frequency}=\frac{\text { Category frequency }}{\text { Total number of data}}\nonumber\]
Proportions (Relative Frequency) can be expressed as fractions, decimals, or percentages. For example, relative frequency could be \(0.35\) or \(35\%\).
Recall the example in which a teacher recorded the responses on the first question of a multiple-choice quiz, with five possible responses (A, B, C, D, and E). The raw data was as follows.
| A | A | C | A | B | B | A | E | A | C | A | A | A | C |
| E | A | B | A | A | C | A | B | E | E | A | A | C | C |
We computed a frequency distribution, relative frequency, and cumulative frequency.
- Answer
-
To compute a proportion, we need the frequency (which is provided in the table above) and the total number of units represented in our data. We can find that by adding up the frequencies from all the categories: \(0+14+4+4+6=28\).
To find the proportions, we divide the frequency by the total. For the first category (“A”), the proportion is \(\frac{14}{28}=0.50=50\%\). We can compute the other proportions similarly, filling in the rest of the table:
Category of Data Frequency Proportion
(Relative Frequency)
Cumulative Frequency D \(0\) \(\frac{0}{28}=0=0\%\) \(0\) A \(14\)
\(\frac{14}{28}=0.50=50\%\)\(0+14=14\) B \(4\) \(\frac{4}{28}=0.143=14.3\%\)
\(14+4=18\) E \(4\) \(\frac{4}{28}=0.143=14.3\%\) \(18+4=22\) C \(6\) \(\frac{6}{28}=0.214=21.4\%\) \(22+6=28\) Check your work: If you add up your proportions, you should get \(1\) or \(100\%\). And frequency should be added to the total number of data in the data set.
Sometimes we need an even more intuitive way of displaying data. This is where charts and graphs come in. There are many, many ways of displaying data graphically, but we will concentrate on one very useful type of graph called a bar graph. In this section, we will work with bar graphs that display categorical data; the next section will be devoted to graphs that display quantitative data.
A bar graph is a graph that displays a bar for each category, with the length of each bar indicating the frequency of that category.
Note: A bar graph is only used to display categorical data.
To construct a bar graph, we need to draw a vertical axis and a horizontal axis. The vertical direction will have a scale and measure the frequency of each category; the horizontal axis has no scale in this instance, but only the names of each category. The construction of a bar chart is most easily described by use of an example.
An insurance company determines vehicle insurance premiums based on known risk factors. If a person is considered a higher risk, their premiums will be higher. One potential factor is the color of your car. The insurance company believes that people with some color cars are more likely to get in accidents. To research this, they examine police reports for recent total-loss collisions. The data is summarized in the frequency table below.
| Color | Frequency | Relative Frequency |
| Blue | \(25\) | \(\frac{25}{216}=0.1157=11.57\%\) |
| Green | \(52\) | \(\frac{52}{216}=0.2407=24.07\%\) |
| Red | \(41\) | \(\frac{41}{216}=0.1898=18.98\%\) |
| White | \(36\) | \(\frac{36}{216}=0.1667=16.67\%\) |
| Black | \(39\) | \(\frac{39}{216}=0.1806=18.06\%\) |
| Grey | \(23\) | \(\frac{23}{216}=0.1065=10.65\%\) |
| Total | \(216\) | \(1=100\%\) |
Using our car data from above, note the highest frequency is \(52\), so our vertical axis needs to go from \(0\) to \(52\), but we might as well use \(0\) to \(55\), so that we can put a hash mark every \(5\) units:
Notice that the height of each bar is determined by the frequency of the corresponding color. The horizontal gridlines are a nice touch, but not necessary. In practice, you will find it useful to draw bar graphs using graph paper, where the gridlines are already in place, or by using technology. Instead of gridlines, we might also list the frequencies at the top of each bar, like this:
In this case, our chart might benefit from being reordered from largest to smallest frequency values. This arrangement can make it easier to compare similar values in the chart, even without gridlines. When we arrange categories in decreasing frequency order, it is called a Pareto chart.
A Pareto chart is a bar graph ordered from highest to lowest frequency.
Transforming our bar graph from earlier into a Pareto chart, we get:
Another way to represent qualitative data is with a pie chart. A pie chart is useful because it shows how a whole is divided into parts. It allows people to quickly compare proportions or percentages and easily see which categories make up the largest or smallest parts of the data. Pie charts are especially helpful when there are only a few categories and the goal is to show how each category contributes to the total (100%).
A pie chart is a circle with wedges cut out of varying sizes marked out like slices of pie or pizza. The relative sizes of the wedges correspond to the relative frequencies of the categories.
For our vehicle color data in the above table, draw a pie chart.
- Answer
-
We use relative frequency to draw a pie chart.
Figure \(\PageIndex{4}\): Pi Chart
Pie charts look nice but are harder to draw by hand than bar charts since to draw them accurately, we would need to compute the angle each wedge cuts out of the circle, then measure the angle with a protractor. Computers are much better suited to drawing pie charts. Common software programs like Microsoft Word or Excel, OpenOffice.org Write or Calc, or Google Docs are able to create bar graphs, pie charts, and other graph types. There are also numerous online tools that can create graphs [2].
Don’t get fancy with graphs! People sometimes add features to graphs that don’t help to convey their information. For example, 3-dimensional bar charts like the one shown below are usually not as effective as their two-dimensional counterparts.
Here is another way that fanciness can lead to trouble. Instead of plain bars, it is tempting to substitute meaningful images. This type of graph is called a pictogram.
A pictograph (also known as a pictogram) is a type of chart that uses images, icons, or symbols to represent data.
A labor union might produce the graph to the right to show the difference between the average manager salary and the average worker salary.
Looking at the picture, it would be reasonable to guess that the manager's salary is \(4\) times as large as the worker's salary – the area of the bag looks about 4 times as large. However, the manager's salaries are in fact only twice as large as worker salaries, which was reflected in the picture by making the manager's bag twice as tall.
The following is another example of a pictograph.
Displaying Quantitative Data
Quantitative, or numerical, data can also be summarized into frequency tables and graphs. A representation of quantitative data is called a histogram. The horizontal axis is a number
Some words we use to describe distributions are uniform (data are equally distributed across the range), symmetric (data are bunched up in the middle, then taper off in the same way above and below the middle), left-skewed (data are bunched up at the high end or larger values, and taper off toward the low end or smaller values), and right-skewed (data are bunched up at the low end, and taper off toward the high end). See the figures below.
A teacher records scores on a \(20\)-point quiz for the \(30\)students in his class. The scores are
\(19\) \(20\) \(18\) \(18\) \(17\) \(17\) \(19\) \(17\) \(20\) \(18\) \(20\) \(16\) \(20\) \(15\) \(17\) \(12\) \(18\) \(19\) \(18\) \(19\) \(17\) \(20\) \(18\) \(16\) \(15\) \(18\) \(20\) \(5\) \(0\) \(0\)
These scores could be summarized into a frequency table by grouping like values:
| Score | Frequency | Relative Frequency |
|---|---|---|
| \(0\) | \(2\) | \(\frac{2}{30}=0.067=6.7\%\) |
| \(5\) | \(1\) | \(\frac{1}{30}=0.033=3.3\%\) |
| \(12\) | \(1\) | \(\frac{1}{30}=0.033=3.3\%\) |
| \(15\) | \(2\) | \(\frac{2}{30}=0.067=6.7\%\) |
| \(16\) | \(2\) | \(\frac{2}{30}=0.067=6.7\%\) |
| \(17\) | \(4\) | \(\frac{4}{30}=0.133=13.33\%\) |
| \(18\) | \(8\) | \(\frac{8}{30}=0.2667=26.67\%\) |
| \(19\) | \(4\) | \(\frac{4}{30}=0.1333=13.33\%\) |
| \(20\) | \(6\) | \(\frac{6}{30}=0.2000=20.00\%\) |
| Total | \(30\) | \(1=100\%\) |
Using this table, it would be possible to create a standard bar chart from this summary, as we did for categorical data:
The Bar Graph (For Qualitative Data)
In a bar graph, each bar represents a separate category. For example, if you survey people on their favorite fruit, "Apple" and "Banana" are independent categories. There is no "in-between" value between an apple and a banana, which is why we leave spaces between the bars.
The Histogram (For Quantitative Data)
A histogram groups numerical data into bins (class intervals). For example, if you are measuring the heights of people in a room, you might have a bin for "\(150\) cm to \(160\) cm" and another for "\(160\) cm to \(170\) cm." The bars touch because \(160.10\) cm follows immediately after \(160\) cm—the data flows continuously.
Here’s a clear comparison between bar graphs and histograms:
| Feature | Bar Graph | Histogram |
|---|---|---|
| Data Type | Categorical (qualitative) data | Numerical (quantitative) data |
| Bars | Separated by gaps | Bars touch each other (continuous data) |
If we have a large number of widely varying data values, creating a frequency table that lists every possible value as a category would lead to an exceptionally long frequency table and probably would not reveal any patterns. For this reason, it is common with quantitative data to group data into class intervals. A class interval is the range of values used to group data in a frequency distribution.
Class intervals are groupings of the data. In general, we define class intervals so that
- Each interval is equal in size. For example, if the first class contains values from \(120-129\), the second class should include values from \(130-139\).
- Each interval has a lower limit and an upper limit, e.g., for interval \(120-129\), \(120\) is the lower limit and \(129\) is the upper limit.
- The class width is the difference between two consecutive lower limits.
- The class width is the same for every interval in the frequency table.
- We typically have between \(5\) and \(20\) classes, depending on the amount of data we’re working with.
Suppose that we have collected weights from \(100\) male subjects as part of a nutrition study. For our weight data, we have values ranging from a low of \(121\) pounds to a high of \(263\) pounds, giving a total span of \(263-121 = 142\). We could create \(7\) intervals with a width of around \(20\), \(14\) intervals with a width of around \(10\) , or somewhere in between. Often, we have to experiment with a few possibilities to find something that accurately represents the data. Let us try using an interval width of \(15\). We could start at \(121\) , or at \(120\) since it is a nice round number.
| Interval | Frequency |
|---|---|
| \(120-134\) | \(4\) |
| \(135-149\) | \(14\) |
| \(150-164\) | \(16\) |
| \(165-189\) | \(28\) |
| \(180-194\) | \(12\) |
| \(195-209\) | \(8\) |
| \(210-224\) | \(7\) |
| \(225-239\) | \(6\) |
| \(240-254\) | \(2\) |
| \(255-269\) | \(3\) |
Notice, the class width is \(15\) since \(150-135 = 15\), \(165-150 = 15\), and so on.
A histogram of this data would look like:
In many software packages, you can create a graph similar to a histogram by putting the class intervals as the labels on a bar chart.
Other graph types, such as pie charts, are possible for quantitative data. The usefulness of different graph types will vary depending on the number of intervals and the type of data being represented. For example, a pie chart of our weight data is difficult to read due to the large number of intervals we used.
An alternative representation is a frequency polygon. A frequency polygon begins like a histogram, but instead of drawing a bar, a point is placed at the midpoint of each interval, with a height equal to the frequency.
Typically, the points are connected with straight lines to emphasize the distribution of the data. A frequency polygon is useful when we want to compare two or more groups on one chart.
This graph makes it easier to see that reaction times were generally shorter for the larger target and that the reaction times for the smaller target were more spread out.
Numerical Summaries of Data
It is often desirable to use a few numbers to summarize a distribution. One important aspect of a distribution is where its center is located. Measures of central tendency are discussed first. A second aspect of a distribution is how spread out it is. In other words, how much the data in the distribution vary from one another. The second section describes measures of variability

