## [1] 12
From the plots done, I can see some seasonality as well as an overall upward trend in the plastics time series data.
Do the results support the graphical interpretation from part a? The trend window definitely shows an upward trend, and the seasonal window shows seasonality. I saw the trend clearly in the when I plotted the time-series previously.
Compute and plot the seasonally adjusted data.
## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 1 742 697 776 898 1030 1107 1165 1216 1208 1131 971 783
## 2 741 700 774 932 1099 1223 1290 1349 1341 1296 1066 901
## 3 896 793 885 1055 1204 2326 1303 1436 1473 1453 1170 1023
## 4 951 861 938 1109 1274 1422 1486 1555 1604 1600 1403 1209
## 5 1030 1032 1126 1285 1468 1637 1611 1608 1528 1420 1119 1013
I randomly chose to add 1000 to the 30th entry of the plastics time series. Let’s take a look at what that does to the seasonally adjusted plot.
There is a clear spike where the outlier was placed. The smooth upward trend now has more variation at the outlier.
## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 1 742 697 776 898 2030 1107 1165 1216 1208 1131 971 783
## 2 741 700 774 932 1099 1223 1290 1349 1341 1296 1066 901
## 3 896 793 885 1055 1204 1326 1303 1436 1473 1453 1170 1023
## 4 951 861 938 1109 1274 1422 1486 1555 1604 1600 1403 1209
## 5 1030 1032 1126 1285 1468 1637 1611 1608 1528 1420 1119 1013
## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 1 742 697 776 898 1030 1107 1165 1216 1208 1131 971 783
## 2 741 700 774 932 1099 1223 1290 1349 1341 1296 1066 901
## 3 896 793 885 1055 1204 1326 1303 1436 1473 1453 1170 1023
## 4 951 861 938 1109 1274 1422 1486 1555 1604 1600 1403 1209
## 5 1030 1032 1126 1285 1468 1637 2611 1608 1528 1420 1119 1013
The length of plastics is 60. I’ll add outliers to the 5th and 55th observation.
It seems that when the outlier is at the beginning or end, it seems to have a less severe impact on the overall trend.
I did not notice anything that was not previously noted.