Blog Post 6

2021-04-16
Featured Image
suppressWarnings(suppressMessages(library("tidyverse")))
# Running Pre-Process R Script
source(here::here("content", "load_and_clean_data.R"))
# Reading Main Dataset
dataset <- read_csv(here::here("dataset", "Main_Dataset.csv"))
# Multi-Collinearity Test
Mulcol<-data.frame(dataset$SPREAD, dataset$SP500, dataset$GOLD, dataset$OIL, dataset$CHHUSD, dataset$JPYUSD, dataset$RGDP, dataset$UNRATE, dataset$rec)

round(cor(Mulcol), digits = 2)
##                dataset.SPREAD dataset.SP500 dataset.GOLD dataset.OIL
## dataset.SPREAD           1.00         -0.12         0.34        0.30
## dataset.SP500           -0.12          1.00         0.65        0.50
## dataset.GOLD             0.34          0.65         1.00        0.80
## dataset.OIL              0.30          0.50         0.80        1.00
## dataset.CHHUSD          -0.32         -0.55        -0.88       -0.74
## dataset.JPYUSD          -0.34         -0.20        -0.60       -0.57
## dataset.RGDP            -0.11          0.00        -0.19       -0.24
## dataset.UNRATE           0.77         -0.34         0.40        0.37
## dataset.rec             -0.08         -0.20        -0.11        0.07
##                dataset.CHHUSD dataset.JPYUSD dataset.RGDP dataset.UNRATE
## dataset.SPREAD          -0.32          -0.34        -0.11           0.77
## dataset.SP500           -0.55          -0.20         0.00          -0.34
## dataset.GOLD            -0.88          -0.60        -0.19           0.40
## dataset.OIL             -0.74          -0.57        -0.24           0.37
## dataset.CHHUSD           1.00           0.58         0.16          -0.34
## dataset.JPYUSD           0.58           1.00         0.10          -0.51
## dataset.RGDP             0.16           0.10         1.00          -0.17
## dataset.UNRATE          -0.34          -0.51        -0.17           1.00
## dataset.rec              0.12           0.22        -0.55          -0.01
##                dataset.rec
## dataset.SPREAD       -0.08
## dataset.SP500        -0.20
## dataset.GOLD         -0.11
## dataset.OIL           0.07
## dataset.CHHUSD        0.12
## dataset.JPYUSD        0.22
## dataset.RGDP         -0.55
## dataset.UNRATE       -0.01
## dataset.rec           1.00
# Option to fillNA with last non NA Value
# library(zoo)
# DataframeName <- na.locf(Main_Dataset)

Today we talked and implementing two different ways as to importing our data. One involves running our pre-process R script, which contains our entire data. The other method just involves reading the final clean and tidy data set we converted into a csv file. Additionally, we added a preliminary multi-collinearity test. We discovered from this preliminary test that there exist a signficant relationship between Unemployment rate and Spread. This is something to consider in our variable selection process. We also discussed about a technique to fillNA with last NA value to help tidy our datasets. Finally, we discussed about potential interactive plots such as, a logistical regression interactive visual and also an interactive time series graph.

Previous Blog Post 7