26 Simple Statistical Methods for Software Engineering
Geometric mean can also be calculated from the arithmetic mean of the loga-
rithm of the n numbers. en this must be converted back to a “base 10 number”
by using an antilogarithm.
A geometric mean, unlike an arithmetic mean, tends to mitigate the effect of
outliers, which might bias the mean if a straight average (arithmetic mean) was
calculated.
e geometric mean for bug repair time given in Table 2.1 is found to be 17.9.
We can use the Excel function GEOMEAN to calculate this. In this case, it may
be noted that the geometric mean is almost equal to the median value. It may be
Table 2.1 Bug Repair Time
Number of Days
16 31 7
23 19 28
45 18 29
20 18 12
13 21 49
13 39 20
58 14 21
9 11 49
7 11 14
29 9 15
13 25 13
12 25 6
32 20 28
31 17 21
31 13 23
33 13 13
6 13 16
31 24 10
26 12 14
21 7 14
Truth and Central Tendency 27
remembered that all data values are not used in the median computation, whereas
every data value is used in the geometric mean.
ere are certain financial return calculations where geometric mean is the
right choice. If an investment earns 20% in the first year, 40% in the second year,
50% in the third year, and 60% in the fourth year, the average return is not the
arithmetic mean of 42.5% but the geometric mean of 41.703%. It is an error to use
the arithmetic mean in this case.
Jeff and Lewis [1] have studied tasks times in usability tests that are positively
skewed. ey report that the median does not use all the information available in
a sample. Using the geometric mean, they have achieved 13% less error and 22%
less bias than the median.
Harmonic Mean
With positive data, we have yet another statistic to yield central tendency without
bias from extreme values: the harmonic mean. It is even more protective than geo-
metric mean, that is,
HM =
+ + +
N
x x x
N
1 1 1
1 2
....
To find the harmonic mean of a set of n numbers, we add the reciprocals of the
numbers in the set, divide the sum by n, then take the reciprocal of the result. e
harmonic mean is the reciprocal of the arithmetic mean of reciprocals. is gives
further screening from extreme values. e harmonic mean for bug repair time data
given in Table 2.1 is 15.6 days. is value is closer to the mode than the median, the
geometric mean, or the mean.
e Excel function to find harmonic mean is HARMEAN.
A formal treatment of geometric and harmonic means may be found in the
Handbook of Means and eir Inequalities by Bullen [2].
Interconnected Estimates
In interpreting the central tendency of software data, so much depends on the
situation. In most cases, data are skewed; therefore, mean, median, and mode are
different. In such cases, there is no one word answer to central tendency. ere are
three values that need to be studied and interpreted.
Consider the case of repair time of a particular category of bugs in a software
development project. Bug repair time data are given in Table 2.1.
28 Simple Statistical Methods for Software Engineering
e following are the five values of central tendency:
Arithmetic mean 20.517
Median 18.000
Mode 13.000
Geometric mean 17.867
Harmonic mean 15.561
e team leader wants to set a goal for bug repair time and also wants to plan
resources for the next quarter based on the bug arrival forecast. He wants to take
data-driven decisions. He wants optimum decisions too. Which expression of truth
will he use?
If we subscribe to the approach that people should follow best practices, the
mode should be used to define goal. Aggressive goal setting can still be based on
the best performance demonstrated: mode. We need a realistic value to be used in
resource planning. We can either choose the median or the mean. Mean is safer
and can provide a comfortable cushion. However, then we will be overplanning the
resources. A look at the data set shows that maximum value is 58 days. We realize
that such extreme values have biased mean values and deteriorated its application
potential. us, the mean is rejected. A fair answer could be the median.
If the data are positive but skewed, then the geometric and harmonic means can
be used. Hence, if the data are complex, we need to look at the multiple estimates
of central tendency instead of just the mean.
Weighted Mean
ere are times when we weight data x with factors w and find the weighted average
using the following formula:
x
w x
w
i i
i
n
i
i
n
=
=
=
1
1
In the Program Evaluation and Review Technique (PERT) calculation, the esti-
mated schedule is a weighted mean of three values:
Optimistic value {O} Weight 1
Pessimistic value {P} Weight 1
Most likely value {ML} Weight 4
Truth and Central Tendency 29
Estimate =
+ +
+ +
1 4 1
1 4 1
O ML P
Expert judgment of a milestone schedule (days) is shown in Table 2.2. A proper
estimate is obtained by applying weighted average.
In the previous example, the arithmetic mean is 50 days, and the weighted
mean is 45 days.
Robust Means
e robust estimate of the mean is less aected by extreme values.
Trimmed Mean
Arithmetic mean breaks down if an extreme value is introduced. Even the presence
of one extreme value can change this mean. In other words, it has a 0 breakdown
point.
Trimming data gives us robust estimates of the mean, in the sense that the
mean is resistant to changes in outlier data. Calculating the arithmetic mean after
removing x% of data in the lower side and x% of data in the higher side will lead us
to x% trimmed mean. Practically, x% can vary from 3% to 25%; x% is also called
breakdown point.
In schools, the mean score of a class is calculated after removing 5% from the
top and 5% from the bottom scores. It is 5% trimmed mean.
In process management, trimming is not a very straightforward step. Trouble in
the process is normally revealed in the outliers. We identify outliers and do root cause
analysis on them for process improvement. We cannot mindlessly discard extreme
values while data cleaning. We can trim data to find a robust expression for central
tendency, but the removed data have meaning elsewhere and need to be stored.
For more on trimmed means, refer to the thesis by Wu [3].
Table 2.2 Expert Judgment of Milestone Schedule (Days)
Weight Data Weighted Data
Optimistic 1 20 20
Most likely 4 40 160
Pessimistic 1 90 90
Average 50 45
30 Simple Statistical Methods for Software Engineering
Winsorized Mean
Winsorized mean is similar to the trimmed mean. However, instead of trimming
the points, they are set to the lowest or highest value. e beneficial properties of
Winsorized means for skewed distributions are discussed by Rivest [4].
Midhinge
is is the average of the first and the third quartiles (the 25th and the 75th percen-
tiles). is is a robust estimate.
Midrange
Midrange is the average of the smallest and the largest data.
Tukey’s Trimean
is is obtained from the quartiles using the formula
Trimean =
+ +Q Q Q
1 2 3
2
4
Mean Derived from Geometrical Perspectives
Interesting geometric-based definitions of mean are summarized by Umberger [5].
Different means are seen as geometric properties of trapezoids.
Two Categories
We can divide expressions of central tendency into two categories. In the first cat-
egory, we obtain participation from all observations in calculating central tendency.
ere are just three expressions that belong to this category. ese measures natu-
rally support mathematical modeling.
Category 1
1. Mean: we can use mean as a first-order judgment of central tendency
Mean gives true value if we replicated an experiment.
Estimating mean removes random noise.
Mean provides a basis for building normal distribution from data.
Mean is affected by extreme values.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.134.188