{r} {include=FALSE} library(dplyr) library(ggplot2) library(forecast) library(tseries) library(TSA)
data <- read.csv("NJURN.csv")
summary(data)
## observation_date NJURN
## 2010-01-01: 1 Min. : 3.000
## 2010-04-01: 1 1st Qu.: 4.900
## 2010-07-01: 1 Median : 6.650
## 2010-10-01: 1 Mean : 6.808
## 2011-01-01: 1 3rd Qu.: 9.175
## 2011-04-01: 1 Max. :10.200
## (Other) :32
UR <- ts(data$NJURN, frequency=3, start=c(2010, 1), end=c(2019, 4))
plot(UR)
Based on the plot shown by the unemployment rate you can clearly see there is a downward trend. Additionally, one can determine there is slight increase in unemployment rate towards the end and beginning of most years.
UR <- ts(data$NJURN, frequency=3, start=c(2010, 1), end=c(2019, 4))
deunemployment = decompose(UR, type="additive")
plot(deunemployment)
s=deunemployment$seasonal
plot(s)
s
## Time Series:
## Start = c(2010, 1)
## End = c(2020, 1)
## Frequency = 3
## [1] -0.02024691 0.03679012 -0.01654321 -0.02024691 0.03679012 -0.01654321
## [7] -0.02024691 0.03679012 -0.01654321 -0.02024691 0.03679012 -0.01654321
## [13] -0.02024691 0.03679012 -0.01654321 -0.02024691 0.03679012 -0.01654321
## [19] -0.02024691 0.03679012 -0.01654321 -0.02024691 0.03679012 -0.01654321
## [25] -0.02024691 0.03679012 -0.01654321 -0.02024691 0.03679012 -0.01654321
## [31] -0.02024691
When working with additive decomposition we see that all the seasonal indicies are not close to 1. What this means is we do have seasonality with the unemployment data. We can claim that unemployrment rate in NJ does have seasonalality. This supports our findings in the graphical intepretation from the initial plot.
dataoutlier <- read.csv("NJURN-with-outlier.csv")
URoutlier <- ts(dataoutlier$NJURN, frequency=3, start=c(2010, 1), end=c(2019, 4))
plot(URoutlier)
deunemploymentoutlier = decompose(URoutlier, type="additive")
plot(deunemploymentoutlier)
s=deunemploymentoutlier$seasonal
plot(s)
s
## Time Series:
## Start = c(2010, 1)
## End = c(2020, 1)
## Frequency = 3
## [1] -0.3961728 0.7497531 -0.3535802 -0.3961728 0.7497531 -0.3535802
## [7] -0.3961728 0.7497531 -0.3535802 -0.3961728 0.7497531 -0.3535802
## [13] -0.3961728 0.7497531 -0.3535802 -0.3961728 0.7497531 -0.3535802
## [19] -0.3961728 0.7497531 -0.3535802 -0.3961728 0.7497531 -0.3535802
## [25] -0.3961728 0.7497531 -0.3535802 -0.3961728 0.7497531 -0.3535802
## [31] -0.3961728
dataoutlierend <- read.csv("NJURN-with-outlier-end.csv")
URoutlierend <- ts(dataoutlierend$NJURN, frequency=3, start=c(2010, 1))
plot(URoutlierend)
deunemploymentoutlierend = decompose(URoutlierend, type="additive")
plot(deunemploymentoutlierend)
s=deunemploymentoutlierend$seasonal
plot(s)
s
## Time Series:
## Start = c(2010, 1)
## End = c(2022, 2)
## Frequency = 3
## [1] -0.4111111 -0.4527778 0.8638889 -0.4111111 -0.4527778 0.8638889
## [7] -0.4111111 -0.4527778 0.8638889 -0.4111111 -0.4527778 0.8638889
## [13] -0.4111111 -0.4527778 0.8638889 -0.4111111 -0.4527778 0.8638889
## [19] -0.4111111 -0.4527778 0.8638889 -0.4111111 -0.4527778 0.8638889
## [25] -0.4111111 -0.4527778 0.8638889 -0.4111111 -0.4527778 0.8638889
## [31] -0.4111111 -0.4527778 0.8638889 -0.4111111 -0.4527778 0.8638889
## [37] -0.4111111 -0.4527778
Although we changed one of the observations to be an outlier; the output for the seasonally adjusted data seems to remain consistent as with no outlier included, based on the plots shown. However, we can see that some of the seasonal indicies begin to move closer to one. Indicating that there is no seasonality. Whether the outlier is near the end rather than the middle of the series seems to hold no significant effect on the results as the overall effect is similiar in both instances.