First, sort the data from least to greatest:
{3, 5, 6, 7, 7, 7, 8, 8}
The quartiles of this set are 3 values that separate the list into 4 groups,
• the lowest 25% of the set
• the lower-middle 25% of the set
• the upper-middle 25% of the set
• the highest 25% of the set
Since there are 8 data points, each set consists of 2 data points:
• {3, 5}
• {6, 7}
• {7, 7}
• {8, 8}
The quartiles are then the average of the adjacent endpoints of these sets. That is,
• the first quartile is (5 + 6)/2 = 5.5
• the second quartile (a.k.a. median) is (7 + 7)/2 = 7
• the third quartile is (7 + 8)/2 = 7.5
The IQR is the difference between the third and first quartiles, so
IQR = 7.5 - 5.5 = 2