Читать книгу Statistics and Probability with Applications for Engineers and Scientists Using MINITAB, R and JMP - Bhisham C. Gupta, Irwin Guttman - Страница 54

2.4.2 Pie Chart

Оглавление

Pie charts are commonly used to describe qualitative data from one population. It is constructed by dividing a circle into various slices that represent different categories of a population. As examples: allocation of the federal budget by sector, revenues of a large manufacturing company by region or by plant, technicians in a large corporation who are classified according to their basic qualification: high‐school diploma, an associate degree, an undergraduate degree, a graduate degree, and so on. The pie chart helps us better understand at a glance the composition of the population with respect to the characteristic of interest.

To construct a pie chart, divide a circle into slices such that each slice representing a category is proportional to the size of that category. Since the total angle of a circle is 360°, the angle of a slice corresponding to a given category is determined as follows:

(2.4.1)

We illustrate the construction of a pie chart with the following example:

Example 2.4.2 (Manufacturing defect types) In a manufacturing operation, we are interested in understanding defect rates as a function of various process steps. The inspection points (categories) in the process are initial cutoff, turning, drilling, and assembly. The frequency distribution table for these data is shown in Table 2.4.1. Construct a pie chart for these data.

Table 2.4.1 Understanding defect rates as a function of various process steps.

Process steps Frequency Relative frequency Angle size
Initial cutoff 86 86/361 = 23.8% 85.76
Turning 182 182/361 = 50.4% 181.50
Drilling 83 83/361 = 23.0% 82.77
Assembly 10 10/361 = 2.8% 9.97
Total 361 100% 360.00

Solution: The pie chart for these data is constructed by dividing the circle into four slices. The angle of each slice is given in the last column of Table 2.4.1. Then, the pie chart for the data of Table 2.4.1 is as shown in the MINITAB printout in Figure 2.4.2. Clearly, the pie chart gives us a better understanding at a glance about the rate of defects occurring at different steps of the process.


Figure 2.4.2 Pie chart for the data in Table 2.4.1 using MINITAB.

MINITAB

Using MINITAB, the pie chart is constructed by taking the following steps:

1 Enter the category in column C1.

2 Enter frequencies of the categories in column C2.

3 From the Menu bar, select Graph Pie Chart. Then, check the circle next to Chart values from a table on the pie chart dialog box that appears on the screen.

4 Enter C1 under Categorical values and C2 under Summary variables.

5 Note that if we have the raw data without having the frequencies for different categories, then check the circle next to Chart counts of unique values. In that case, the preceding dialog box would not contain a box for Summary variables.

6 Click Pie Options and in the new dialog box that appears select any option you like and click OK. Click Lables and in the new dialog box that appears select the Slice Labels from the box menu and select Percent option and click OK. The pie chart will appear as shown in Figure 2.4.2.

USING R

We can use the built in ‘pie()’ function in R to generate pie charts. If a pie chart with percentages desired, then the percentages of the categories should be calculated manually. Then, these percentages should be used to label the categories. The task can be completed by running the following R code in the R Console window.

Freq = c(86, 182, 83, 10) #To label categories Process = c(‘Initial cutoff’, ‘Turning’, ‘Drilling’, ‘Assembly’) #To calculate percentages Percents = round(Freq/sum(Freq)*100,1) label = paste(Percents, ‘%’, sep=‘ ’) # add % to labels #Pie Chart with percentages pie(Freq, labels = label, col=c(2,3,4,5), main=‘Pie Chart of Process Steps’) #To add a legend. Note: “pch” specifies various point shapes. legend(‘topleft’, Process, col=c(2,3,4,5), pch=15)

Statistics and Probability with Applications for Engineers and Scientists Using MINITAB, R and JMP

Подняться наверх