On this page
5.3 Graphics
Statistical graphs are forms of presentation of statistical data, whose objective is to produce, in the researcher or the general public, a faster and more vivid impression of the phenomenon under study. The graphical representation of a phenomenon must meet certain fundamental requirements to be truly useful:
Simplicity: The graph must be devoid of details of secondary importance, as well as unnecessary features that could lead the observer to an incorrect analysis.
Clarity: The graph must enable a correct interpretation of the representative values of the phenomenon under study.
Veracity: The graph must express the truth about the phenomenon under study.
Some examples of graphs have already been seen previously, such as the histogram and the Pareto diagram. Next we present the boxplot and dotplot.
5.3.1 Boxplot
The boxplot is a graph used to evaluate the empirical distribution of data. The boxplot is formed by the first and third quartile and the median. The lower and upper rods extend, respectively, from the lower quartile to the smallest value not less than the lower limit and from the upper quartile to the largest value not greater than the upper limit. Limits are the maximum or minimum within the ranges below.
Lower limit: $\max(\min(\text{dados});Q_1-1,5(Q_3-Q_1))$.
Upper limit: $\min(\max(\text{dados});Q_3+1,5(Q_3-Q_1))$.
In this case, points outside these limits are considered outliers and are denoted by an asterisk (*). Figure 3.1 below presents an example of the format of a boxplot.
Figure 3.1: Boxplot
The boxplot can also be used for a visual comparison between two or more groups. For example, two or more boxes are placed side by side and the variability between them, the median, and so on are compared. Another important point is the difference between the quartiles $(Q_3 - Q_1)$ which is a measure of data variability.
Example 3.1.1
In Table 3.1 below we have the height measurements of 20 rods manufactured in one machining process. Make the corresponding boxplot.
| 903,88 | 1036,92 | 1098,04 | 1011,26 |
| 1020,70 | 915,38 | 1014,53 | 1097,79 |
| 934,52 | 1214,08 | 993,45 | 1120,19 |
| 860,41 | 1039,19 | 950,38 | 941,83 |
| 936,78 | 1086,98 | 1144,94 | 1066,12 |
Table 3.1: Machining data
We have to:
| Minimum | 860,41 |
| Maximum | 1214,08 |
| First Quartile | 938,0425 |
| Third Quartile | 1095,0875 |
| Average | 1019,3685 |
| Median | 1017,615 |
Table 3.1.1: Descriptive Statistics of the data
First, let’s calculate the measurements:
$Q_1-1,5(Q_3-Q_1) = 938,0425-1.5(1095,0875-938,0425)=702,475$
$Q_3+1,5(Q_3-Q_1) = 1095,0875+1,5(1095,0875-938,0425)=1330,655$
Lower limit: $\max(\min(\text{dados});Q_1-1,5(Q_3-Q_1)) = \max(860.41;702,475) = 860.41$
Upper limit: $\min(\max(\text{dados});Q_3+1,5(Q_3-Q_1)) = \min(1214,08;1330,655) = 1214.08$
The boxplot obtained by the Action Stat software is given by:
Figure 3.2: Boxplot of machining data
Example 3.1.2
Using the data from Example 2.3.4 (Height of patients), we have
| Descriptive Statistics | |
|---|---|
| Minimum | 1,58 |
| 1st Quartile | 1,6 |
| Median | 1,69 |
| 3rd Quartile | 1,8 |
| Maximum | 1,87 |
| Lower limit | 1,58 |
| Upper limit | 1,87 |
Table 3.2: Descriptive statistics of patient height data
Thus, we obtain the following boxplot by Action Stat:
Figure 3.3: Boxplot of patient height data
We can use the Boxplot to compare stratified data and compare differences in the empirical distributions of the strata.
Example 3.1.3
An industry produces an automotive part whose reference value is 75cm. After checking batches with out-of-specification parts, they sent two teams of workers (A and B) for training. To verify the efficiency of the training, 10 parts produced by teams A and B and 10 parts produced by teams C and D that did not participate in the training were selected.
| A | A | B | B | C | C | D | D |
|---|---|---|---|---|---|---|---|
| 75,27 | 74,93 | 74,94 | 74,75 | 75,93 | 73,34 | 75,98 | 76,75 |
| 75,33 | 74,72 | 75,25 | 74,65 | 76,95 | 74,04 | 75,61 | 76,78 |
| 74,58 | 74,53 | 75,44 | 74,94 | 75,47 | 75 | 74,2 | 74,74 |
| 75,01 | 75,32 | 74,62 | 74,92 | 73,6 | 76,18 | 76,44 | 72,58 |
| 75,71 | 74,05 | 75,35 | 75,46 | 74,85 | 75,33 | 76,84 | 72,86 |
Table 3.3: Data from 40 parts produced by 4 teams
Figure 3.4: Boxplot by groups
Analyzing the graph we can see that:
- Teams A and B produce parts with less variability, indicating that the training had the desired effect;
- Team D is the one that produces parts with the greatest variability;
- Team B is the one that produces parts with the least variability.
Considerations: As the pieces from teams A and B have less variability and an average value close to the reference value, it is worth sending the other teams for training.
5.3.2 Dotplot
The Dotplot graph (dot graph) represents each observation obtained on a horizontal scale, allowing you to visualize the distribution of data along this axis. On the horizontal axis, we divide the scale of values into small intervals, with one point being marked per observation.
Dotplot, or dot plot, is very useful for visualizing stratifications. Stratification is a technique that groups data into subgroups, according to certain criteria, increasing the power of the analysis.
Example 3.2.1
Considering again the data from Example 3.1.1, we build the Dotplot graph using Action Stat:
Figure 3.5: Point graph of machining data (Table 3.1)
Eventually, it is interesting to analyze stratified data, that is, to perform a dotplot in groups. We can graphically analyze which group (stratum) has the greatest dispersion and get an idea of the location of the average for each group.
Example 3.2.2
A small survey carried out in 4 neighborhoods (A, B, C and D) of a city asked about the net salary of 32 families (8 families from each neighborhood). The results obtained (data in reais) are in Table 3.4 below:
| A | B | C | D |
|---|---|---|---|
| 3620 | 1910 | 4900 | 2800 |
| 4010 | 2100 | 4100 | 2400 |
| 4560 | 2210 | 5520 | 2900 |
| 2760 | 2030 | 6200 | 2950 |
| 3480 | 2090 | 5800 | 3400 |
| 2930 | 2230 | 7200 | 3200 |
| 3070 | 2060 | 4700 | 3150 |
| 3200 | 2050 | 5600 | 2770 |
Table 3.4: Net salary of families from 4 different neighborhoods in reais
Using Action Stat software, we generated the following graph:
Figure 3.6: Graph of points by neighborhood
Analyzing the graph, we can see that:
- The poorest neighborhood, on average, is neighborhood B. However, it is the one with the least variability between salaries.
- The second poorest neighborhood, on average, is neighborhood D, followed by neighborhood A. The variation between salaries in these two neighborhoods is similar.
- The richest neighborhood is neighborhood C, but it is the one with the greatest variability between family salaries.
5.3.3 Line Chart
Line or dot charts are typically used to track changes over time and to make it easier to identify trends or anomalies.
Example 3.3.1
The number of maintenance operations per day on equipment was monitored over a period of 5 weeks, in an automobile company. In Table 3.6 below we have the number of maintenances per day.
| Number of maintenance | Day | Week |
|---|---|---|
| 18 | 1 | Week 1 |
| 22 | 2 | Week 1 |
| 28 | 3 | Week 1 |
| 23 | 4 | Week 1 |
| 33 | 5 | Week 1 |
| 23 | 6 | Week 1 |
| 22 | 7 | Week 1 |
| 32 | 1 | Week 2 |
| 14 | 2 | Week 2 |
| 24 | 3 | Week 2 |
| 38 | 4 | Week 2 |
| 14 | 5 | Week 2 |
| 22 | 6 | Week 2 |
| 35 | 7 | Week 2 |
| 24 | 1 | Week 3 |
| 24 | 2 | Week 3 |
| 28 | 3 | Week 3 |
| 25 | 4 | Week 3 |
| 20 | 5 | Week 3 |
| 23 | 6 | Week 3 |
| 14 | 7 | Week 3 |
| 20 | 1 | Week 4 |
| 30 | 2 | Week 4 |
| 27 | 3 | Week 4 |
| 24 | 4 | Week 4 |
| 38 | 5 | Week 4 |
| 27 | 6 | Week 4 |
| 23 | 7 | Week 4 |
| 19 | 1 | Week 5 |
| 18 | 2 | Week 5 |
| 17 | 3 | Week 5 |
| 24 | 4 | Week 5 |
| 27 | 5 | Week 5 |
| 23 | 6 | Week 5 |
| 32 | 7 | Week 5 |
Table 3.6: Number of maintenance per day in 5 weeks
We can build the graph in two ways: with or without a goal.
No goal
In this case, we set up a two-dimensional graph where we place a point in the ordered pair corresponding to the day of the week and the observed value, then we join each point to its successor by straight lines. The graph is given in Figure 3.7.1 below:
Figure 3.7.1: Line and Point Chart without goal
With goal
In goal analysis, we simply determine a value (goal) for comparing the data and then insert a horizontal line at the height of this value. As a result, all points above the given value reached the goal, while those below did not reach the goal.
We will use the same data as above, setting a target of 22. The graph is given below:
Figure 3.7.2: Line and Point Chart with goal
The graphs above were obtained using the Action software.
Example 3.3.2
In Table 3.7 below, we have data relating to the evolution of the price of a financial asset over 20 days.
| Day 1 | 103,60 | Day 11 | 109,21 |
| Day 2 | 104,41 | Day 12 | 108,13 |
| Day 3 | 105,21 | Day 13 | 108,76 |
| Day 4 | 106,00 | Day 14 | 109,45 |
| Day 5 | 105,18 | Day 15 | 110,12 |
| Day 6 | 106,80 | Day 16 | 109,56 |
| Day 7 | 104,89 | Day 17 | 111,67 |
| Day 8 | 105,23 | Day 18 | 112,32 |
| Day 9 | 107,60 | Day 19 | 110,97 |
| Day 10 | 108,41 | Day 20 | 111,34 |
Table 3.7: Evolution of the price of a financial asset over 20 days
Next, we construct the line and point graph for this data.
Figure 3.8: Line and Point Chart