#Housing Inventory: Active Listing Count in the United States (ACTLISCOUUS)Housing_Inventory <-fredr(series_id ="ACTLISCOUUS") |>transmute(month =yearmonth(date),value) |>as_tsibble(index = month)autoplot(Housing_Inventory, value) +labs(title ="Housing Inventory: Active Listing Count in the U.S.",x ="Month",y ="Active Listings") #Not Stationary, Downward Trend and Then Upward Trend
adf.test(Housing_Inventory$value) #The Augmented Dickey-Fuller test returned a p-value of 0.9698, which is greater than 0.05. Therefore, we fail to reject the null hypothesis of a unit root, indicating that the time series is non-stationary. This is consistent with the observed trend and seasonality in the data.
Augmented Dickey-Fuller Test
data: Housing_Inventory$value
Dickey-Fuller = -0.68087, Lag order = 4, p-value = 0.9698
alternative hypothesis: stationary
adf.test(na.omit(housing_diff1$diff_1)) #P value 0.01 -> Series is Stationary
Augmented Dickey-Fuller Test
data: na.omit(housing_diff1$diff_1)
Dickey-Fuller = -6.8908, Lag order = 4, p-value = 0.01
alternative hypothesis: stationary
# ACF and PACF Interpretation:# The ACF plot of the first-differenced series shows a strong spike at lag 1,# followed by a gradual decay, which is indicative of a moving average process.# The PACF plot also shows an initial spike at lag 1 but does not exhibit a clear# cutoff, instead tapering off across subsequent lags. This pattern suggests that# autoregressive terms are less dominant, while a moving average component is more appropriate.# # Based on these observations, I selected an ARIMA(0,1,1) model, where:# p = 0 reflects the lack of a clear autoregressive cutoff in the PACF,# d = 1 accounts for the first differencing required to achieve stationarity,# and q = 1 captures the strong lag 1 correlation observed in the ACF.# # While a seasonal spike is visible at lag 12 in the ACF, the model is intentionally# kept simple for this analysis, focusing on the dominant short-term dynamics.
#Retail Sales: Retail Trade (MRTSSM44000USN)Retail_Sales <-fredr(series_id ="MRTSSM44000USN") |>transmute(month =yearmonth(date),value) |>as_tsibble(index = month)autoplot(Retail_Sales, value) +labs(title ="Retail Sales: Retail Trade Millions of DOllars, U.S.",x ="Month",y ="Millions of Dollars") #Not Stationary, Upward Trend With Extreme Seasonality
adf.test(Retail_Sales$value) #The Augmented Dickey-Fuller test returned a p-value of 0.9789, which is greater than 0.05. Therefore, we fail to reject the null hypothesis of a unit root, indicating that the time series is non-stationary. This is consistent with the observed trend and seasonality in the data.
Augmented Dickey-Fuller Test
data: Retail_Sales$value
Dickey-Fuller = -0.56141, Lag order = 7, p-value = 0.9789
alternative hypothesis: stationary