---
title: "Report of Timeseries and Regression Analysis Economic Indicator"
output:
flexdashboard::flex_dashboard:
vertical_layout: scroll
theme: sandstone
source_code: embed
---
```{r setup, include=FALSE}
# Importing libraries
library(flexdashboard)
library(tidyverse)
library(highcharter)
library(gt)
library(htmltools)
library(viridis)
library(DT)
library(ggplot2)
library(sunburstR)
library(lubridate)
library(plotly)
library(ggplot2)
library(readxl)
library(plotly)
library(tidyverse)
library(lubridate)
library(aTSA)
library(stats)
library(lmtest)
library(forecast)
library(car)
library(nortest)
library(caret)
library(tibble)
```
```{r}
dataecoind <- read_excel("Dataeconomicindicator.xlsx")
```
Table {data-orientation=rows}
=======================================================================
## Column {.tabset .tabset-fade data-height=520}
-----------------------------------------------------------------------
### Economic Indicator {data-height=520}
```{r}
datatable(dataecoind,
options=list(scrollX=TRUE),
caption = htmltools::tags$caption(
style = 'caption-side: bottom; text-align: center;',
'Table: ', htmltools::em('Data Economic Indicator')
))
```
### Table Forecast Inflation Rate {data-height=520}
```{r fig.height=5}
a <- dataecoind[,c(2)]
a <- ts(a, start = c(2010, 1), frequency = 12)
fig <- plot_ly(dataecoind, x = ~Month, y = ~InR, type = 'scatter', mode = 'lines') %>%
layout(title = "Inflation Rate")
predicta <- forecast(a, model = auto.arima(a), h=12, level = c(95))
data.frame(predicta)
```
### Table Forecast GDP Growth Rate{data-height=520}
```{r fig.height=5}
b <- dataecoind[,c(3)]
b <- ts(b, start = c(2010, 1), frequency = 12)
fig <- plot_ly(dataecoind, x = ~Month, y = ~GDP, type = 'scatter', mode = 'lines') %>%
layout(title = "Inflation Rate")
predictb <- forecast(b, model = auto.arima(b), h=12, level = c(95))
data.frame(predictb)
```
### Table Forecast Unemployment Rate {data-height=520}
```{r fig.height=5}
c <- dataecoind[,c(4)]
c <- ts(c, start = c(2010, 1), frequency = 12)
fig <- plot_ly(dataecoind, x = ~Month, y = ~Up, type = 'scatter', mode = 'lines') %>%
layout(title = "Inflation Rate")
predictc <- forecast(c, model = auto.arima(c), h=12, level = c(95))
data.frame(predictc)
```
### Table Forecast Interest Rate {data-height=520}
```{r fig.height=5}
d <- dataecoind[,c(5)]
d <- ts(d, start = c(2010, 1), frequency = 12)
predictd <- forecast(d, model = auto.arima(d), h=12, level = c(95))
data.frame(predictd)
```
### Table Forecast Customer Confidence Index {data-height=520}
```{r fig.height=5}
e <- dataecoind[,c(6)]
e <- ts(e, start = c(2010, 1), frequency = 12)
predicte <- forecast(e, model = auto.arima(e), h=12, level = c(95))
data.frame(predicte)
```
### Table Forecast Stock Market Index {data-height=520}
```{r fig.height=5}
f <- dataecoind[,c(7)]
f <- ts(f, start = c(2010, 1), frequency = 12)
predictf <- forecast(f, model = auto.arima(f), h=12, level = c(95))
data.frame(predictf)
```
### Table Forecast Exchange Rate {data-height=520}
```{r fig.height=5}
g <- dataecoind[,c(8)]
g <- ts(g, start = c(2010, 1), frequency = 12)
predictg <- forecast(g, model = auto.arima(g), h=12, level = c(95))
data.frame(predictg)
```
Inflation Rate {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$InR, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(a, lag.max = 36)
```
### Plot PACF
```{r}
pacf(a, lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predicta, main = "Forecast for Inflation Rate")
```
GDP Growth Rate {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$GDP, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(diff(b), lag.max = 36)
```
### Plot PACF
```{r}
pacf(diff(b), lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predictb, main = "Forecast for GDP Growth Rate")
```
Unemployment Rate {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$Up, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(diff(c), lag.max = 36)
```
### Plot PACF
```{r}
pacf(diff(c), lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predictc, main = "Forecast for Unemployment Rate")
```
Interest Rate {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$IR, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(diff(d), lag.max = 36)
```
### Plot PACF
```{r}
pacf(diff(d), lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predictd, main = "Forecast for Interes Rate")
```
Customer Confidence Index {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$CCI, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(diff(e), lag.max = 36)
```
### Plot PACF
```{r}
pacf(diff(e), lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predicte, main = "Forecast for Customer Confidence Index")
```
Stock Market Index {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$SMI, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(diff(f), lag.max = 36)
```
### Plot PACF
```{r}
pacf(diff(f), lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predictf, main = "Forecast for Stock Market Index")
```
Exchange Rate {data-orientation=rows}
=======================================================================
Row {data-width=700}
-----------------------------------------------------------------------
### Decomposition
```{r message=FALSE, warning=FALSE}
plot(stl(ts(dataecoind$ER, frequency = 12), s.window = "periodic"))
```
Row {data-width=350}
-----------------------------------------------------------------------
### Plot ACF
```{r message=FALSE, warning=FALSE}
acf(diff(g), lag.max = 36)
```
### Plot PACF
```{r}
pacf(diff(g), lag.max = 36)
```
Row {data-width=700}
-----------------------------------------------------------------------
### Visualize of Forecast
```{r message=FALSE, warning=FALSE}
plot(predictg, main = "Forecast for Exchange Rate")
```