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. An information dashboard could serve as a principle tool to be used in industry, government, non-profits, and academic fields to compensate for the information overload. The companies considered in the analysis include JP Morgan, Tesla, Microsoft and Amazon. The purpose of this dashboard is to provide analysis of various factors considered in stock analysis.
Which factors are considered for analysis of stocks? Answer: After researching and studying the data, Price/Earnings (P.E) Ratio, earnings per share (EPS) Estimate next year and market capitalization were considered.
What do these factors indicate about the stocks? Answer: Microsoft shows higher capitalization of market, JP Morgan shows higher P.E. ratio and Amazon shows higher EPS estimate next year
What does the stock closing price indicate? Answer: The trend for stock closing prices is similar for all companies over the past five years. However, Tesla had reached its peak in January 2022 surpassing other stocks.
How does the monthly return vary among different stocks? Answer: The monthly returns for Tesla are highest whereas it is lowest for JP Morgan.
Conclusion: The overall analysis shows trends in stocks from 2017 - 2023. An earnings estimate is an analyst’s estimate for a company’s future quarterly or annual earnings per share (EPS). Future earnings estimates are arguably the most important input when attempting to value a firm. Price to earnings ratio, or P/E, is a way to value a company by comparing the price of a stock to its earnings. The P/E equals the price of a share of stock, divided by the company’s earnings-per-share. It indicates the value a shareholder is paying for each dollar of earnings. Market capitalization refers to the total value of all a company’s shares of stock. As depicted in the analysis, Microsoft shows higher capitalization of market, JP Morgan shows higher P.E. ratio and Amazon shows higher EPS estimate next year. Hence, it implies that these companies are in different phases of investment, production and execution of their projects. Although, the closing prices and monthly returns are low in January 2023, previous patterns indicate that they might increase and it would be a good time for investors to enter the stock market.
---
title: "ANLY 512 - Stocks Dashboard"
author: "Sneha Yerunkar"
date: "01-26-2023"
output:
flexdashboard::flex_dashboard:
orientation: rows
Horizontal_layout: fill
social: menu
source: embed
html_document: default
df_print: paged
pdf_document: default
---
# Table of Contents {.sidebar}
* Introduction
* Stock Analysis
* Closing Prices of Stocks
* Monthly Returns of Stocks
* Conclusion
# **Introduction**
Row {data-height=230}
-------------------------------------
### **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.
An information dashboard could serve as a principle tool to be used in industry, government, non-profits, and academic fields to compensate for the information overload. The companies considered in the analysis include JP Morgan, Tesla, Microsoft and Amazon. The purpose of this dashboard is to provide analysis of various factors considered in stock analysis.
Row
-------------------------------------
### **Objective**
1. Which factors are considered for analysis of stocks?
2. What do these factors indicate about the stocks?
3. What does the stock closing price indicate?
4. How does the monthly return vary among different stocks?
```{r setup, include=FALSE}
library(flexdashboard)
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)
df <- yahooQF(c("Price/Sales","Earnings/Share","P/E Ratio","Price/EPS Estimate Next Year","PEG Ratio","Dividend Yield","Market Capitalization"))
tickers <- c( "JPM", "MSFT", "TSLA", "AMZN")# Not all the metrics are returned by Yahoo.
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=df)
metrics <- data.frame(Symbol=tickers, metrics[,2:length(metrics)])#Change colnames#
colnames(metrics) <- c("Symbol", "P-E Ratio", "Price EPS Estimate Next Year","Div Yield", "Market Cap")
kableExtra::text_spec("**Earning Share**", color = "blue")
kableExtra::text_spec("**P-E Ratio**", color = "green")
kableExtra::text_spec("**Market Capitalization**", color = "red")
kableExtra::text_spec("**Closing Price**", color = "orange")
##Stocks considered in the Study
getSymbols("MSFT",from="2017-01-1",to="2023-01-1")
MSFT_log_returns<-MSFT%>%Ad()%>%dailyReturn(type='log')
getSymbols("TSLA",from="2017-01-1",to="2023-01-1")
TSLA_log_returns<-TSLA%>%Ad()%>%dailyReturn(type='log')
getSymbols("JPM",from="2017-01-1",to="2023-01-1")
JPM_log_returns<-JPM%>%Ad()%>%dailyReturn(type='log')
getSymbols("AMZN",from="2017-01-1",to="2023-01-1")
AMZN_log_returns<-AMZN%>%Ad()%>%dailyReturn(type='log')
tickers <- c("JPM", "MSFT", "TSLA", "AMZN")
metrics<-data.frame(na.fill(metrics,0))
```
# **Stock Analysis**
## Column{data-height=900 .tabset .tabset-fade}
-----------------------------------------------------------------------
### Earnings per share (EPS) Estimate Next Year
```{r}
ggplot(metrics,aes(x=Symbol,y=Price.EPS.Estimate.Next.Year,fill=Symbol))+
geom_col()+
labs(x="Company name",y="Price.EPS.Estimate.Next.Year")
```
### Price to Earnings Ratio (P/E Ratio) {data-width=900}
```{r}
ggplot(metrics,aes(x=Symbol,y=P.E.Ratio,fill=Symbol))+
geom_col()+
labs(x="Company name",y="P/E Ratio")
```
### Market Capitalization {data-width=900}
```{r}
ggplot(metrics,aes(x=Symbol,y=Market.Cap,fill=Symbol))+
geom_col()+
coord_polar("y",start=0)
```
# **Closing Prices of Stocks**
```{r}
ClosingPrices <- do.call(merge, lapply(tickers, function(x) Cl(get(x))))
dateWindow<-c("2017-01-1", "2023-01-1")
dygraph(ClosingPrices, main="Stock Closing Price", group="Stock") %>%
dyAxis("y", label="Closing Price ($) ") %>%
dyOptions( colors = RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightSeriesBackgroundAlpha = 0.5,
highlightSeriesOpts = list(strokeWidth = 3))%>%
dyRangeSelector(height = 35, dateWindow=dateWindow)
```
# **Monthly Returns of Stocks**
```{r}
m.rt.TSLA <- monthlyReturn(TSLA)
m.rt.JPM <- monthlyReturn(JPM)
m.rt.AMZN <- monthlyReturn(AMZN)
m.rt.MSFT <- monthlyReturn(MSFT)
mg.return <- merge.xts(m.rt.TSLA,m.rt.JPM, m.rt.AMZN, m.rt.MSFT)
colnames(mg.return) <- c('Tesla','JPMorgan Chase & Co','Amazon','MicrosoftCorporation')
dateWindow<-c("2017-01-1", "2023-01-1")
dygraph(mg.return, main = "Monthly Return") %>%
dyAxis("y", label = "Return") %>%
dyOptions(colors = RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightSeriesBackgroundAlpha = 0.5,
highlightSeriesOpts = list(strokeWidth = 4)) %>%
dyRangeSelector(height = 35, dateWindow=dateWindow)
```
# **Analysis & Conclusion**
1. Which factors are considered for analysis of stocks?
Answer: After researching and studying the data, Price/Earnings (P.E) Ratio, earnings per share (EPS) Estimate next year and market capitalization were considered.
2. What do these factors indicate about the stocks?
Answer: Microsoft shows higher capitalization of market, JP Morgan shows higher P.E. ratio
and Amazon shows higher EPS estimate next year
3. What does the stock closing price indicate?
Answer: The trend for stock closing prices is similar for all companies over the past five years. However, Tesla had reached its peak in January 2022 surpassing other stocks.
4. How does the monthly return vary among different stocks?
Answer: The monthly returns for Tesla are highest whereas it is lowest for JP Morgan.
Conclusion:
The overall analysis shows trends in stocks from 2017 - 2023. An earnings estimate is an analyst's estimate for a company's future quarterly or annual earnings per share (EPS). Future earnings estimates are arguably the most important input when attempting to value a firm. Price to earnings ratio, or P/E, is a way to value a company by comparing the price of a stock to its earnings. The P/E equals the price of a share of stock, divided by the company's earnings-per-share. It indicates the value a shareholder is paying for each dollar of earnings. Market capitalization refers to the total value of all a company's shares of stock. As depicted in the analysis, Microsoft shows higher capitalization of market, JP Morgan shows higher P.E. ratio and Amazon shows higher EPS estimate next year. Hence, it implies that these companies are in different phases of investment, production and execution of their projects. Although, the closing prices and monthly returns are low in January 2023, previous patterns indicate that they might increase and it would be a good time for investors to enter the stock market.