Sure! To find the outlier score of inflation from 2009 to 2016, we can follow these steps:
- Collect data on inflation rates from 2009 to 2016. Let's assume we have the following monthly inflation rates (in percentages):
3.2, 2.7, 2.2, 1.5, 1.9, 2.8, 3.0, 3.8, 2.7, 2.5, 2.0, 1.6, 1.8, 1.9, 1.5, 1.1, 1.0, 0.7, 0.2, 0.2, 0.1, 0.1, 0.2, 0.2, 0.2, 0.4, 0.2, 0.2, 0.6, 0.5, 0.3, 0.7, 1.3, 1.5, 1.6, 1.0, 1.3, 0.8, 0.5, 0.2, 0.0, 0.2, 0.3, 0.3, 0.3, 0.2, 0.2, 0.4, 0.3, 0.3, 0.4, 0.5, 0.4, 0.4, 0.2, 0.1, 0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.5, 0.5, 0.4, 0.3, 0.2, 0.2, 0.2, 0.1, 0.2, 0.2, 0.4, 0.5, 0.4, 0.2, 0.2, 0.2, 0.0, 0.1, 0.2, 0.2, 0.2, 0.1, 0.2, 0.3, 0.3, 0.2, 0.2, 0.3, 0.3, 0.5, 0.4, 0.2, 0.1, 0.1, 0.2, 0.2, 0.2, 0.3, 0.2, 0.3, 0.3, 0.2, 0.1, 0.2, 0.2, 0.2, 0.1, 0.2, 0.2, 0.3, 0.3, 0.3, 0.3, 0.3, 0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.3, 0.2, 0.2, 0.3, 0.3, 0.4, 0.4, 0.4, 0.3, 0.2, 0.3, 0.3, 0.4, 0.5, 0.5, 0.3, 0.2, 0.1, 0.0, 0.1, 0.2, 0.3, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.4, 0.4, 0.3, 0.2, 0.2, 0.2, 0.2, 0.3, 0.4, 0.4, 0.3
- Calculate the mean and mean absolute deviation (MAD) of the inflation rates.
The mean is simply the average of the inflation rates:
mean = (3.2 + 2.7 + ... + 0.3) / 95 = 1.4%
The MAD is the average of the absolute deviations of the inflation rates from the mean:
MAD = (|3.2 - 1.4| + |2.7 - 1.4| + ... + |0.3 - 1.4|) / 95 = 0.705%
- Divide the MAD by the mean to get the coefficient of variation (CV):
CV = MAD / mean = 0.705 / 1.4 = 0.5036
- Calculate the outlier score for each data point using the IQR method.
First, we need to calculate the IQR:
IQR = Q3 - Q1
where Q1 is the first quartile (25th percentile) and Q3 is the third quartile (75th percentile) of the data. We can use a box plot or a statistical software to get these values. Let's assume we have:
Q1 = 0.2%
Q3 = 0.4%
Then, the IQR is:
IQR = 0.4 - 0.2 = 0.2%
Next, we can calculate the lower and upper boundaries for outliers:
Lower boundary = Q1 - 1.5 x IQR = 0.2 - 1.5 x 0.2 = -0.1%
Upper boundary = Q3 + 1.5 x IQR = 0.4 + 1.5 x 0.2 = 0.7%
Any data point that falls outside of these boundaries is considered an outlier. We can calculate the outlier score for each data point as follows:
Outlier score =
0 if the data point is within the boundaries
(|data point - mean| / MAD) x sign(data point - mean) if the data point is outside the boundaries
where sign(x) is the sign function that returns -1 if x < 0, 0 if x = 0, and 1 if x > 0.
For example, the first data point (3.2%) falls outside the upper boundary, so its outlier score is:
|3.2 - 1.4| / 0.705 x 1 = 2.566
Similarly, the third data point (2.2%) falls inside the boundaries, so its outlier score is 0.
We can calculate the outlier score for each data point in this way and identify the ones that have the highest scores as the most extreme outliers.