Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to conduct analyses or create tools to support quantitative decision making.
A principle tool used in industry, goverment, non-profits, and academic fields to compensate for the information overload is the information dashboard. Functionally, a dashboard is meant to provide a user with a central resource to present in a clear and concise manner all the information neccessary to support day-to-day decision making and support operations.
The objective of this laboratory is to plan, design, and create an information dashboard to support quantitative decision making. To accomplish this task you will have to complete a number of steps:
You make investments for an organization, your objective is to purchase securities/commodities for the key objective of maximizing profits. You want to make an investment in securities/commodities to make some short term gains. You are considering investing in one of any four companies, for example: Twitter (TWTR), Microsoft (MSFT), or Apple (AAPL) (don’t use these). Choose 4 companies or commodities and determine which one of the four will produce the most short term gains. Use your imagination.
There are lots of places we can get financial data to support these decision. The simplest would be to go to for instance to the Yahoo Finance (https://finance.yahoo.com/) for data on the Hershey Company (HSY) the URL would be: (https://finance.yahoo.com/quote/HSY/history?p=HSY) and collect historical price data, and other financial and company information.
Here we have a summarized table for the key financial indicators to evaluate the quality of four companies from different industries: JP Morgan, SAP, Oracle and HP. The indicators to be noted are P-E Ratio, EPS Estimate Next Year, Dividend Yield and Market cap.
These 4 companies are large in term of Market cap and it will be interesting to see how the analysis of each gives a better picture and helps us make a decision as to which stock is best for short term gains.
At a glance, SAP has the highest P-E ratio and EPS among these four companies. A high P-E Ratio means that SAP has a fast growth and a good indicator for potentioal investors but it also can be over valued so there is an inherent risk. JPM seems to have a decent P-E ratio as well as EPS. On the surface, JPM seems to be the best bet.
[1] "JPM"
[1] "SAP"
[1] "ORCL"
[1] "HP"
In addition to the individual stock analysis, here is the comparison of their Monthly return in one combined plot.
From the indicators as well as monthly returns, JPM would be my suggested stock for short term gains.
---
title: "ANLY 512: Data Visualization"
subtitle: "Dashboards Laboratory"
author: "Mrugank Salunke"
date: "6/16/2020"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: [ "menu" ]
source: embed
vertical_layout: fill
---
Instruction
=====================================
Row {data-height=320}
-------------------------------------
### **Overview**
Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to conduct analyses or create tools to support quantitative decision making.
A principle tool used in industry, goverment, non-profits, and academic fields to compensate for the information overload is the information dashboard. Functionally, a dashboard is meant to provide a user with a central resource to present in a clear and concise manner all the information neccessary to support day-to-day decision making and support operations.
Row {data-height=680}
-------------------------------------
### **Objective**
The objective of this laboratory is to plan, design, and create an information dashboard to support quantitative decision making. To accomplish this task you will have to complete a number of steps:
1. Delineate the necessary decision (I will do that)
2. Identify what information will be relevant to decision making.
3. Find and collect the data necessary to create your visualization plan.
4. Organize and summarize the collected data.
5. Design and create the best visualizations to present that information.
6. Finally organize the layout of those visualizations in a way that conforms to the theory of dashboarding.
7. Write a summary about what decisions you made based on the visualizations that you developed.
### **The Decision & Rules**
You make investments for an organization, your objective is to purchase securities/commodities for the key objective of maximizing profits. You want to make an investment in securities/commodities to make some short term gains. You are considering investing in one of any four companies, for example: Twitter (TWTR), Microsoft (MSFT), or Apple (AAPL) (don’t use these). Choose 4 companies or commodities and determine which one of the four will produce the most short term gains. Use your imagination.
### **Methods Help**
##### *Getting data*
There are lots of places we can get financial data to support these decision. The simplest would be to go to for instance to the Yahoo Finance (https://finance.yahoo.com/) for data on the Hershey Company (HSY) the URL would be: (https://finance.yahoo.com/quote/HSY/history?p=HSY) and collect historical price data, and other financial and company information.
Key Indicator Analysis
=====================================
##### **Indicators**
+ `r kableExtra::text_spec("**P-E Ratio**", color = "Black")` - Price to earning ratios is a good way to understand if the company is over or under valued. It also tells us the growth rate
+ `r kableExtra::text_spec("**EPS**", color = "Black")` - Earnings per share. The portion of a company’s profit that is allocated to each outstanding share of its common stock.
+ `r kableExtra::text_spec("**Dividend Yield Ratio**", color = "Black")` - The dividend yield, expressed as a percentage, is a financial ratio that shows how much a company pays out in dividends each year relative to its stock price
+ `r kableExtra::text_spec("**Market Cap**", color = "Black")` - Total value of all a company’s shares of stock. It is calculated by multiplying the price of a stock by its total number of outstanding shares.
##### **Key Indicator Analysis at a glance**
Here we have a summarized table for the key financial indicators to evaluate the quality of four companies from different industries: JP Morgan, SAP, Oracle and HP. The indicators to be noted are P-E Ratio, EPS Estimate Next Year, Dividend Yield and Market cap.
These 4 companies are large in term of Market cap and it will be interesting to see how the analysis of each gives a better picture and helps us make a decision as to which stock is best for short term gains.
At a glance, SAP has the highest P-E ratio and EPS among these four companies. A high P-E Ratio means that SAP has a fast growth and a good indicator for potentioal investors but it also can be over valued so there is an inherent risk.
JPM seems to have a decent P-E ratio as well as EPS. On the surface, JPM seems to be the best bet.
# Indicators
```{r}
library(quantmod)
library(plyr)
what_metrics <- yahooQF(c("Price/Sales",
"P/E Ratio",
"Price/EPS Estimate Next Year",
"PEG Ratio",
"Dividend Yield",
"Market Capitalization"))
tickers <- c( "JPM", "SAP", "ORCL", "HP")
metrics <- getQuote(paste(tickers, sep = "", collapse = ";"), what = what_metrics)
metrics <- data.frame(Symbol = tickers, metrics[,2:length(metrics)])
colnames(metrics) <- c("Symbol", "P-E Ratio", "Price EPS Estimate Next Year", "Div Yield", "Market Cap")
write.csv(metrics, "FinancialMetrics.csv", row.names = FALSE)
DT::datatable(metrics)
```
Individual Stock Analysis
=====================================
#### **Stocks**
```{r, echo = TRUE, include = FALSE, message = FALSE}
install.packages("xts",repos = "http://cran.us.r-project.org")
install.packages("dygraphs",repos = "http://cran.us.r-project.org")
install.packages("lubridate",repos = "http://cran.us.r-project.org")
install.packages("DT",repos = "http://cran.us.r-project.org")
install.packages("pdfetch", repos = "http://cran.us.r-project.org")
install.packages("PerformanceAnalytics", repos = "http://cran.us.r-project.org")
install.packages("stocks", repos = "http://cran.us.r-project.org")
library(xts)
library(pdfetch)
library(DT)
library(lubridate)
library(dygraphs)
library(quantmod)
library(dplyr)
library(knitr)
library(ggplot2)
library(tidyr)
library(plyr)
library(PerformanceAnalytics)
library(stocks)
library(kableExtra)
```
```{r, echo=FALSE}
getSymbols("JPM", from = "2018-01-01", to = "2020-01-1")
JPMlog <- JPM %>% Ad() %>% dailyReturn(type = 'log')
getSymbols("SAP", from = "2018-01-01",to = "2020-01-1")
SAPlog <- SAP %>% Ad() %>% dailyReturn(type = 'log')
getSymbols("ORCL", from = "2018-01-01",to = "2020-01-1")
ORCLlog <- ORCL %>% Ad() %>% dailyReturn(type = 'log')
getSymbols("HP", from = "2018-01-01",to = "2019-01-1")
HPlog <- HP %>% Ad() %>% dailyReturn(type = 'log')
```
```{r, echo = TRUE, include = FALSE, message = FALSE}
#install.packages("tidyquant")
library("tidyquant")
library("ggplot2")
JPM1 <- tq_get("JPM", get = "stock.prices", from = "2018-01-01", to = "2020-01-01")
SAP1 <- tq_get("SAP", get = "stock.prices", from = "2018-01-01", to = "2020-01-01")
ORCL1 <- tq_get("ORCL", get = "stock.prices", from = "2018-01-01", to = "2020-01-01")
HP1 <- tq_get("HP", get = "stock.prices", from = "2018-01-01", to = "2020-01-01")
```
Row {.tabset .tabset-fade}
-------------------------------------
### JP Morgan
```{r}
# Setup dates for zoom window
end <- ymd("2020-01-01")
start <- end - weeks(20)
# Create chart
JPM1 %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "JPM: Line Chart",
subtitle = "This is good, but doesn't give us open, high, low, or direction information",
x = "", y = "Closing Price")
JPM1 %>%
ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, close = close, high = high, low = low)) +
labs(title = "JPM: Candlestick",
subtitle = "Visually shows open, high, low, and close information, along with direction",
x = "", y = "Closing Price")
```
### SAP
```{r}
# Create chart
SAP1 %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "SAP: Line Chart",
subtitle = "This is good, but doesn't give us open, high, low, or direction information",
x = "", y = "Closing Price")
SAP1 %>%
ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, close = close, high = high, low = low)) +
labs(title = "SAP: Candlestick",
subtitle = "Visually shows open, high, low, and close information, along with direction",
x = "", y = "Closing Price")
```
### ORACLE
```{r}
# Create chart
ORCL1 %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "ORACLE: Line Chart",
subtitle = "This is good, but doesn't give us open, high, low, or direction information",
x = "", y = "Closing Price")
ORCL1 %>%
ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, close = close, high = high, low = low)) +
labs(title = "ORACLE: Candlestick",
subtitle = "Visually shows open, high, low, and close information, along with direction",
x = "", y = "Closing Price")
```
### HP
```{r}
# Create chart
HP1 %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "HP: Line Chart",
subtitle = "This is good, but doesn't give us open, high, low, or direction information",
x = "", y = "Closing Price")
HP1 %>%
ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, close = close, high = high, low = low)) +
labs(title = "HP: Candlestick",
subtitle = "Visually shows open, high, low, and close information, along with direction",
x = "", y = "Closing Price")
```
Monthly Return Comparison
=====================================
-------------------------------------
### **Monthly Return Comparison**
In addition to the individual stock analysis, here is the comparison of their Monthly return in one combined plot.
```{r}
JPMmr <- monthlyReturn(JPM)
SAPmr <- monthlyReturn(SAP)
ORCLmr <- monthlyReturn(ORCL)
HPmr <- monthlyReturn(HP)
mg.return <- merge.xts(JPMmr, SAPmr, ORCLmr, HPmr)
colnames(mg.return) <- c("JPM", "SAP", "ORCL", "HP")
dygraph(mg.return, main = "Monthly Return") %>%
dyAxis("y", label = "Return") %>%
dyOptions(colors = RColorBrewer::brewer.pal(4, "Dark2")) %>%
dyHighlight(highlightSeriesBackgroundAlpha = 0.3,
highlightSeriesOpts = list(strokeWidth = 3)) %>%
dyRangeSelector(height = 30)
```
Conclusion
=====================================
-------------------------------------
#### **Conclusion**
From the indicators as well as monthly returns, JPM would be my suggested stock for short term gains.