A histogram is a graphical representation of the output of the FREQUENCY function (as described in Frequency Tables).

Example 1: Create a histogram for the data and bin selection for Example 1 from Frequency Tables.

We start by replicating the data and bin section for Example 1 in Figure 1.

Data example 1

Figure 1 – Data for Example 1

You can use Excel’s chart tool to graph the data in Figure 1, or alternatively you can use the Histogram data analysis tool to accomplish this directly, as described next.

Excel Data Analysis Tool: To use Excel’s Histogram data analysis tool, you must first establish a bin array (as for the FREQUENCY function described in Frequency Tables) and then select the Histogram data analysis tool. In the dialog box that is displayed you next specify the input data (Input Range) and bin array (Bin Range). You can optionally include the labels for these ranges (in which case you check the Labels check box).

For Example 1, the Input Range is A4:B14 and the Bin Range is D4:D7 (with the Labels check box unchecked). The output is displayed in Figure 2.

Histogram data analysis tool

Figure 2 – Histogram data analysis tool

Observation: Caution must be exercised when creating histograms to present the data in a clear and accurate way. For most purposes it is important that the intervals be equal in size (except for an unbounded first and/or last interval). Otherwise a distorted picture of the data may be presented.

To avoid this problem equally-spaced intervals can be used. This is the approach illustrated in Example 4 of Frequency Tables using the FREQTABLE supplemental function. Alternatively, the Frequency Table supplemental data analysis tool can be used.

Real Statistics Data Analysis Tool: The Frequency Table data analysis tool provided in the Real Statistics Resource Pack can be used to create a frequency table and histogram as illustrated in the following example.

Example 2: Create a frequency table and histogram for the 22 data elements in the range A4:B14 of Figure 1 based on bins of size 15.

Enter Ctrl-m and select the Frequency Table option. The dialog box shown in Figure 3 will appear.

Frequency table dialog box

Figure 3 – Dialog box for Frequency Table data analysis tool 

Insert A4:B14 in the Input Range field, select Raw data as the Input format and insert 15 as the Bin Size. The output is shown in Figure 4.

Frequency table histogram

Figure 4 – Frequency Table and Histogram

Note that if 100 is inserted in the Maximum bin value (or blank) field of Figure 3 then the output is shown in Figure 5.

Histogram frequency table

Figure 5 – Frequency Table and Histogram (revised)

Observation: You can also produce a frequency table (and histogram) of the type described in Example 3 of Discrete Probability Distributions (i.e. without specifying any bins) via the Frequency Table data analysis tool. In this case you would select Raw data as the Input format for the dialog box shown in Figure 3 and leave the Bin size field blank.

3 Responses to Histograms

  1. Kelly says:

    Dear Charles,

    How can I come up with Kernel Density Estimation from this Histogram?

    Best regards,

Leave a Reply

Your email address will not be published. Required fields are marked *