Section 1.6 Adjusting Statistical Measures for Grouped Data
As you considered the measures of the center and spread before, each data point was considered individually. Often, data may however be grouped into categories. The number of data items in each category is called the "frequency" of that outcome and the collection of these frequencies for all outcomes is called a "frequency distribution".
Subsection 1.6.1 Data Grouped into Single-valued Categories
In this case, rather than considering \(x_k\) to be the kth data value can take advantage of the grouping to perhaps save a bit on arithmetic.
Indeed, let's assume that data is grouped into m categories \(x_1, x_2, ..., x_m\) with corresponding frequencies \(f_1, f_2, ..., f_m\text{.}\) Then, for example, when computing the mean rather than adding \(x_1\) with itself \(f_1\) times just compute \(x_1 \times f_1\) for the first category and continuing through the remaining categories. This gives the following grouped data formula for the mean
and the following grouped data formula for the variance (along with one equivalent form)
Consider the following data set
{3, 1, 2, 2, 3, 1, 3, 4, 5, 5, 1, 4, 5, 1, 2, 4, 5, 3, 2, 5, 2, 1, 2, 2, 5}
Create a frequency distribution and determine the sample mean and variance.
Collecting this data into a frequency distribution gives
\(x_k\)
\(f_k\)
1
5
2
7
3
4
4
3
5
6
and
and so \(s^2 = \frac{25}{24} \frac{4826}{625} \approx 8.043\text{.}\)
Subsection 1.6.2 Data Grouped into Continuous Intervals
For measures on data grouped into intervals, it is somewhat difficult to do calculations when the data no longer exists as individual values since all you know is the frequencies of each interval. You can use "class marks"...the midpoints of each interval...as representers for all of the items that fell into that interval for computing means and variances. For positional measures, you want to approach this in the same manner as with percentiles before. That is, my doing some sort of linear interpolation on the width of each interval.
So, for medians, consider the following approach:
- Compute frequencies \(f_k\) and cummulative frequencies \(F_k\) for each class
- Set m = total cummulative frequency/2 = \(F_{last}/2\)
- Determine the interval \(k\) where \(m \in [F_{k-1},F_k]\)
- Set median = \((b_k-a_k)\frac{m - F_{k-1}}{f_k}+a_k\)
Example 1.6.3 Computing Median for Interval Grouped Data
\([a_k,b_k]\)
\(f_k\)
[0,5)
5
[5,10)
7
[10,20)
4
[20,23)
3
[23,30)
6