MATH-1410
C. Haugen
Creating a Frequency Histogram using PHStat2
Refer to problem 34 on page 50 of the text. We were asked to create a frequency histogram for the data set using five classes.
- Enter the data in the first column of the worksheet. Eventually, we are going to need to enter the Bins Cell Range for our histogram. The BinsCell Range tells the PHStat2 program what the upper limits will be for each class along the horizontal axis of the histogram. The range of the data set is 432 (found by subtracting the minimum value of 2456 from the maximum value of 2888). Dividing 432 by 5 gives us 86.4 which we will round up to 87. The number 87 represents the class width of each class. Using 2456 as the lower class limit of the first class and the class width of 87, we can construct two columns as shown below. We will use the entries in column D as our Bins Cell Range.
- Next, we click on the Add-Instab and then click PHStat2 in the Add-Ins ribbon. Click on Descriptive Statistics, then on Histogram & Polygons.
- The Histogram & Polygons dialog box should appear on your screen. Enter the Variable Cell Range by left-clicking on cell A1 and dragging until you reach the last data entry in the first column. Enter the Bins Cell Range by left-clicking on cell D1 and dragging until you reach the last entry in that column. Make sure the First cell in each range contains label box is checked (since we have selected columns with labels). Under Input Options, Single Group Variable should already be checked for us. Under Output Options, if we enter a title, we will see it at the top of the frequency distribution generated along with the histogram. Since we would like our output to include a histogram, we need to check the Histogram box.
Click the Ok button and then we will see something like this in a new window:
Initially, the histogram is difficult to read. Fortunately, there are plenty of tools available to spruce it up. We can expand the chart area by clicking on the lower right-hand corner of the chart and then dragging the mouse. Now that we can see everything, we need to take care of a few problems.
The PHStat2 program was nice enough to include a cumulative relative frequency graph (or ogive) with the histogram. We can get rid of it by clicking on the red line and then pressing the delete key.
Before deletion:
After deletion:
Next, we will change the labels on the horizontal axis to the midpoints of each class. To do that, we need to create a column that has each class midpoint. I decided to enter these values into column F next to the histogram. Once we have done that, right-click on any of the bars in the histogram and choose Select Data from the shortcut menu.
The Select Data dialog box should appear on your screen. Click the Edit button in the Horizontal (Category) Axis Labels box.
The Axis Labels dialog box should appear on your screen. Left-click on the cell containing the first class midpoint and drag the mouse down to the last midpoint.
Click on the Ok button and then click Ok again back in the Select Data dialog box.
We also need to change the title of the histogram and the horizontal axis label. If we click on any of the labels, a box with a solid border should appear. We can move the label anywhere we want and/or resize it. Clicking again on the label should allow us to add our own text. We can eliminate the Frequency legend on the right by clicking on it and then pressing the delete key.
As a final touch, we can add gridlines to our chart area to make things easier to read. We do this by right-clicking on any number along the vertical axis, select Add Major Gridlines from the shortcut menu and voila!
The gridlines are shown below. I have also added borders along the bars in the chart (I will leave it to you to discover how that is done).