Pie Charts

This page builds upon the earlier pages describing the use of the COLLATE2 program. In this case we want to use that program to generate the values that we will need to produce a PIE chart from some discrete values. If this page skips too many steps in describing the use of GNRND4 and COLLATE2 then go back to review the earlier related pages, especially the frequency table and relative frequency table pages.

We need to start with some data. We will generate a list of data on the calculator using GNRND4 with Key 1=154177302 and Key 2=400732. That list will be the same numbers that appear in the following table: Thus, our problem will be to generate a Pie chart for the data in the list above.

Before we tackle the exact values here, let us recall that what we need to do is

Once that is done, then we could draw the circle for the pie, pick some starting radius, and then measure off successive angles for the different pieces of th epie. There will be exactly as many pieces as there are different values in the original list.

The really good news here is that COLLATE2 does all of the work, except drawing the chart, for us.
Figure 1
We start GNRND4 and give it the required key values.
Figure 2
The program produces the values as shown above, and it places those values into L1.
Figure 3
We end the program and select the COLLATE2 program.
Figure 4
The program starts and we give it the location of the input data, namely, L1.
Figure 5
The program produces some display output. We note that there are 5 different values found so our pie will have 5 pieces. Also, we see that there are 74 total entries. If we were to have to do some hand calculations later we would want to know this number.
Figure 6
This is a second page of the display output. Note that we finish the program before we go on. The next step will be to look at the lists that the program produces.
Figure 7
Press to open the STAT menu. Then press to open the Edit... option.
Figure 8
Figure 8 shows us the first lists in the editor. We are interested in these since they give the different valeus found, in this case 732, 733, 734, 735, and 736. It is nice to see the frequency with which these appear. If we had to do any hand calculation we would need to use these frequencies. in particular, to find the number of degrees to allocate to the 734 piece of the pie, we would calculate 360*15/74, where the 74 was the total of all the values in LICNT, and it is the number that we observed in Figure 5.
Figure 9
Fortunately, we do not need to do any of that since the COLLATE2 program provided us with a list that has the results of all of those computations. We just need to move to the right in the display to find the LDPIE list. It holds the number of degrees that we should assign to each piecce. We could put the information of Figures 8 and 9 into our own little table to get
Value FrequencyDegrees
73234165°
7331783°
7341573°
735419°
736419°
This is a good point to note that the degree measures are rounded to the nearest degree. That is why we get 165° for the first piece and 83° for the second even though the first piece needs to be twice the size of the second given the respective frequencies of 34 and 17. The choice to round to the nearest degree, done in the COLLATE2 program seems reasonable since if we were drawing the chart we would be hard pressed to distinguish 82.5° from 83° in our drawing.

©Roger M. Palay
Saline, MI 48176
September, 2012