Silver, Nasdaq Blockchain Economy Index, Bitcoin, and iShares Semiconductor ETF are always thought of as correlated with each other by investors.
We will test this perception with the corrr package.
#iShares Semiconductor ETF (SOXX)
df_soxx <-
tq_get(x = "SOXX") %>%
select(date, soxx = close)
#Silver Futures
df_silver <-
tq_get("SI=F") %>%
select(date, silver = close)
#Nasdaq Blockchain Economy Index
df_nasdaq_blockchain <-
openxlsx::read.xlsx("https://github.com/mesdi/investingcom/raw/refs/heads/main/nasdaq_blockchain.xlsx",
sheet = "History",
detectDates = TRUE) %>%
as_tibble() %>%
janitor::clean_names() %>%
select(date = trade_date, blcn = index_value)
#Bitcoin
df_btc <-
tq_get("BTC-USD") %>%
select(date, btc = close)
#Merging the datasets
df_merged <-
df_silver %>%
left_join(df_soxx) %>%
left_join(df_nasdaq_blockchain) %>%
left_join(df_btc) %>%
drop_na() %>%
filter(date >= last(date) - months(36))
#Correlation
d <- correlate(df_merged, quiet = TRUE)
d %>%
focus(silver:btc, mirror = TRUE) %>%
fashion()
# term silver soxx blcn btc
#1 silver .78 .89 .89
#2 soxx .78 .85 .80
#3 blcn .89 .85 .97
#4 btc .89 .80 .97
#Network plot
df_merged %>%
correlate() %>%
network_plot(min_cor = .7,
legend = "full")

The common perception appears to be correct based on the correlation analysis, specifically between the Nasdaq Blockchain Economy index and Bitcoin.



Leave a reply to Selcuk Disci Cancel reply