This site is designed solely for the use of Mr. Habib's MAT 120 classes. All rights reserved. No part of this site or its contents from MAT textbook (STATISTICS Informed Decisions Using Data by: Michael Sullivan, III) may be reproduced by any process without written permission by the author or publisher and/or Mr. Habib.
How to create a Histogram for Continuous Data
Example 1: Suppose you are considering investing in a Roth IRA. You collect the data in table below, which represent the three-year rate of return (in percents) for a simple random sample of 40 small capitalization growth mutual funds.
In order to construct a frequency distribution, we first create classes of equal width. There are 40 observations in table below and they range from 10.8 to 47.7, so we decide to create the classes such that the lower class limit of the first class is 10.0 (a little smaller than the smallest data value) and the class width is 5. There is nothing magical about the choice of 5 as a class width. We could have selected a class with width of 8 (or any other class width, as well). We simply choose a class width that we think will nicely summarize the data. If our choice doesn’t accomplish this, we can always try another one. The lower class limit of the second class will be 10.0 + 5 = 15.0. Because the classes must not overlap, the upper class limit of the first class is 14.9.
Three-Year Rate of Return of Mutual Funds
|
27.4 |
16.7 |
10.8 |
24.1 |
35.9 |
|
12.7 |
28.5 |
22.2 |
18.4 |
17.4 |
|
22.6 |
29.6 |
11.6 |
45.9 |
16.6 |
|
32.1 |
47.7 |
10.9 |
18.4 |
23.3 |
|
18.2 |
32.0 |
25.5 |
23.7 |
38.1 |
|
23.7 |
14.7 |
12.8 |
31.1 |
21.9 |
|
18.4 |
21.3 |
27.0 |
19.6 |
15.8 |
|
14.7 |
37.0 |
19.2 |
18.5 |
29.1 |
Continuing in this fashion, we obtain the classes in chart below. This gives us eight classes. We tally the number of the observation in each class, add up the tallies, and create the frequency distribution. The relative frequency distribution would be created by dividing each class’s frequency by 40, the number of observations.
Press STAT and ENTER to select 1:Edit. If there is data in L1, highlight L1 at the top of the first list and press CLEAR and ENTER to clear the data. You should also clear L2.
To create this histogram, use the below table:
You must enter the midpoints of each class into List 1 (L1) and the frequencies into List 2 (L2). To obtain the midpoints of each class, add the lower limit plus the upper limit and divide by 2. For example, here is the calculation for the first class: (10.0 + 14.9)/2=12.45.
To enter the midpoints in L1, you can do the calculation for the midpoints right on this screen. Simply type the calculation on the data entry line and push ENTER. The calculation will be automatically converted to the midpoint.
To set up the histogram, push
2nd
and
ENTER to select Plot1. Turn ON Plot1, set Type to Histogram, set Xlist to L1,
set Freq to L2.
Press ZOOM and 9:AoomStat and press ENTER and a histogram will appear on the screen. Press Window to adjust the Graph window. Set Xmin equal to 10.0 (the lower limit of the first class) and Xmax equal to 50.0 (a value that would be the lower limit of an additional class at the end of the table. This extra value is needed to complete the last bar of the histogram.) Set Xscl equal to 5. which is the class width. (Note: In many cases it is not necessary to change the values for Ymin, Yman, or Yscl. What you must do is to check these values and make sure that Ymin is a small negative value (a value between -5 and-1 would be good) and Ymax must be larger than the largest frequency value in your dataset. You never need to adjust Yscl.
Press GRAPH and the histogram should appear.
You can press TRACE and scroll through the bars of the histogram. The minimum value of the class will appear as Min. Max is written as an inequality that states that the maximum value in the class is less than the given value. N is the number of data points in the class.
Notice, for example, with the cursor highlighting the first bar of the histogram, you will see that the first class contains values greater than or equal to 10 and less than 15 and that there are 7 data points in the this class.
Example 2: Dr. Paul Oswiecmiski randomly selects 40 of his 20-29-year-old patients and obtains the following data regarding their serum HDL cholesterol:
|
70 |
56 |
48 |
48 |
53 |
52 |
66 |
48 |
|
36 |
49 |
28 |
35 |
58 |
62 |
45 |
60 |
|
38 |
73 |
45 |
51 |
56 |
51 |
46 |
39 |
|
56 |
32 |
44 |
60 |
51 |
44 |
63 |
50 |
|
46 |
69 |
53 |
70 |
33 |
54 |
55 |
52 |
With the first class having a lower class limit of 20 and a class width of 10.
(a) Construct a frequency distribution.
(b) Construct a relative frequency distribution.
(c) Construct a frequency histogram of the data.
(d) Construct a relative frequency histogram of the data.
(e) Describe the shape of the distribution. Bell-shaped
(f) Repeat parts (a)-(c), using a class width of 5. Which frequency distribution seems to provide a better summary of the data?
For this example, we will construct the histogram (part c.) and then use it to fine the frequencies for the frequency distribution (part a.).
Press STAT and select 1:Edit and press ENTER. Highlight the name “L1” and press CLEAR and ENTER. You can also clear L2 but you will not be using L2 in this example. Enter the data values into L1.
To set up the histogram, push
2nd
and
ENTER to select Plot1. Turn ON Plot1, set Type to Histogram, set Xlist to L1. In
this example, you must set Freq to 1. If the frequency is set on L2 move the
cursor so that it is flashin on L2 and press CLEAR. The cursor is now in ALPHA
mode (notice that there is an “A” flashing in the cursor). Push the ALPHA key
and the cursor should return to a solid flashing square. Type in the number 1.
Press Window to set the Graph Window. The first value you must enter is the value for Xmin. This value will be the lower class limit of the first class which is 10. The value for Xmax would be the lower class limit of the one extra class that would be needed to complete the last bar of the histogram. Look through the data in your textbook. Notice that the largest data point is 73, therefore, the last class would be 70-79. The lower class limit of the next class would be 80. This is the value for Xmax. Set Xscl equal to 10, which is the class width. (Note: In many cases it is not necessary to change the values for Ymin, Yman, or Yscl. What you must do is to check these values and make sure that Ymin is a small negative value (a value between -5 and -1 would be good) and Ymax must be larger than the largest frequency value in your dataset. You never need to adjust Yscl.
Press GRAPH and the histogram should appear.
You can press TRACE and scroll through the bars of the histogram. The minimum value of the class will appear as Min. Max is written as an inequality that states that the maximum value in the class is less than the given value. N is the number of data points in the class.
In the screen shown here, you see that the first class is 20-29 and there is one data point in this class. Use the blue right arrow to scroll through the bars of the histogram and use this information to construct the frequency distribution for part (a) of this problem.
Here is a starting setup for the frequency distribution table:
Enter the remaining classes. Now go through the dataset and complete the frequency column by recording the number of values in each class. To complete the relative frequency column, simply divide each frequency by the total frequency. For example, the relative frequency for the first class would be 1/40.
To do part (f) of the problem, press Window to set the Graph Window. Set Xscl equal to 5. Press GRAPH and the histogram should appear.