This dashboard facilitates to make investment decision in communication service sector with the goal to make short term gains. The data for this task have been imported from Yahoo Finannce. The tickers for the companies are;
This data on communication service sector will be analyzed in stages to determine which is the most profitable comapny in terms of short term gain.
In order to drill down the most profitable comapny for short term gains we looked at many key elements. In the first stage of analysis we looked at P_E_Ratio, EPS Rating, Number of shares traded, etc. and deduced that Netflix, T-Mobile, Verizon, Comcast are the top performers.
This inference was later supported by looking at stock trend for each company. Stock trend provided information on factors like lowest & highes stock price for the given day and closing price. Top performers supported previous inference and companies like Disney, AT&T and Spotify showed heavy fluctuation.
To investigate comapnies with optimal short term gain we looked at closing price variation and number of shares (volume) traded in day for top performers. We looked at stock price variation for the period of Jan, 2020 to Mar, 2020. We can observe from all the graphs that T-Mobile is the most profitable in terms short term gain and Netflix is the best option for long term investment.
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:
We make investments for an organization and our objective is to purchase securities/commodities for the key objective of maximizing profits. We want to make an investment in securities/commodities to make some short term gains. We are considering investing in one of any seven companies, for example: Comcast, Verizon, Spotify, Netflix, T-Mobile, AT&T, Disney. We need to choose 4 companies or commodities and determine which one of the four will produce the most short term gains.
To support the objective of financial decision we are taking data from Yahoo Finance (https://finance.yahoo.com/) and collecting historical price data, and other financial and company information.
We are using packages like dygraphs, ggplot2 to analyze time-series data and produce results.
Please find below the key elements to support the decision.
The price-to-earnings ratio (P/E) is one of the most widely used metrics for investors and analysts to determine stock valuation. In addition to showing whether a company’s stock price is overvalued or undervalued, the P/E can reveal how a stock’s valuation compares to its industry group or a benchmark.A higher P/E ratio shows that investors are willing to pay a higher share price today because of growth expectations in the future. Higher P-E ratio means means company stock may or may not be overvalued. This we will verify from the following stock trend analysis. This will help us to drill down top companies to invest in.
The EPS Rating takes into account the growth and stability of a company’s earnings over the past three years, with extra weighting put on the most recent two quarters. 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.Spotify shows negative EPS so it certainly loses the race against rest of the companies and we will verify this through further analysis.
Two bar graphs have been produced indicating P_E_Ratio and Volume of shares sold per day for each company.
The dygraphs is a fast, flexible open source JavaScript charting library.It allows users to explore and interpret dense data sets.It provides rich facilities for charting time-series data in R and and includes support for many interactive features including series/point highlighting, zooming, and panning.
Here we are generating dygraphs for all the communication sector companies highlighting stock variation over the period of 2015 - 2020. We have considered factors like High price, Low price and closing price while producing these graphs.
From this analysis, we can determine that AT&T, Disney and Spotify show very high fluctuation and Verizon, Comcast, T-mobile and Netflix shows good growth over the time.
From previous and current analysis we can deduce that we will movev forward with Netflix, T-Mobile and Verizon.
[1] "VZ" "T" "CMCSA" "TMUS" "DIS" "NFLX" "SPOT"
[1] "VZ" "NFLX" "TMUS"
---
title: "Investment Dashboard - Kaminee Shimpi"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source: embed
---
```{r setup, include=FALSE}
library(flexdashboard)
```
# Synopsis
Row
-------------------------------------
### Case Scanario
This dashboard facilitates to make investment decision in communication service sector with the goal to make short term gains. The data for this task have been imported from Yahoo Finannce. The tickers for the companies are;
- VZ - Verizon
- T - AT&T
- CMCSA - Comcast
- TMUS - T-Mobile
- DIS - Disney
- NFLX - Netflix
- SPOT - Spotify
This data on communication service sector will be analyzed in stages to determine which is the most profitable comapny in terms of short term gain.
### Conclusion
In order to drill down the most profitable comapny for short term gains we looked at many key elements. In the first stage of analysis we looked at P_E_Ratio, EPS Rating, Number of shares traded, etc. and deduced that Netflix, T-Mobile, Verizon, Comcast are the top performers.
This inference was later supported by looking at stock trend for each company. Stock trend provided information on factors like lowest & highes stock price for the given day and closing price. Top performers supported previous inference and companies like Disney, AT&T and Spotify showed heavy fluctuation.
To investigate comapnies with optimal short term gain we looked at closing price variation and number of shares (volume) traded in day for top performers. We looked at stock price variation for the period of Jan, 2020 to Mar, 2020. We can observe from all the graphs that T-Mobile is the most profitable in terms short term gain and Netflix is the best option for long term investment.
Row {.tabset .tabset-fade}
-------------------------------------
### 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.
### 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:
- Delineate the necessary decision.
- Identify what information will be relevant to decision making.
- Find and collect the data necessary to create your visualization plan.
- Organize and summarize the collected data.
- Design and create the best visualizations to present that information.
- Finally organize the layout of those visualizations in a way that conforms to the theory of dashboarding.
- Write a summary about what decisions you made based on the visualizations that you developed.
### Decision & Rules
We make investments for an organization and our objective is to purchase securities/commodities for the key objective of maximizing profits. We want to make an investment in securities/commodities to make some short term gains. We are considering investing in one of any seven companies, for example: Comcast, Verizon, Spotify, Netflix, T-Mobile, AT&T, Disney. We need to choose 4 companies or commodities and determine which one of the four will produce the most short term gains.
### Methods Help
To support the objective of financial decision we are taking data from Yahoo Finance (https://finance.yahoo.com/) and collecting historical price data, and other financial and company information.
We are using packages like dygraphs, ggplot2 to analyze time-series data and produce results.
# Preliminary Analysis
Row
-------------------------------------
### Chart 1
Please find below the key elements to support the decision.
The price-to-earnings ratio (P/E) is one of the most widely used metrics for investors and analysts to determine stock valuation. In addition to showing whether a company's stock price is overvalued or undervalued, the P/E can reveal how a stock's valuation compares to its industry group or a benchmark.A higher P/E ratio shows that investors are willing to pay a higher share price today because of growth expectations in the future. Higher P-E ratio means means company stock may or may not be overvalued. This we will verify from the following stock trend analysis. This will help us to drill down top companies to invest in.
The EPS Rating takes into account the growth and stability of a company's earnings over the past three years, with extra weighting put on the most recent two quarters. 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.Spotify shows negative EPS so it certainly loses the race against rest of the companies and we will verify this through further analysis.
Two bar graphs have been produced indicating P_E_Ratio and Volume of shares sold per day for each company.
### Chart 2
```{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("VZ","T","CMCSA","TMUS","DIS","NFLX","SPOT")
# Not all the metrics are returned by Yahoo.
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=what_metrics)
#Add tickers as the first column and remove the first column which had date stamps
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")
#Persist this to the csv file
#write.csv(metrics, "FinancialMetrics.csv", row.names=FALSE)
DT::datatable(metrics)
```
Row {.tabset .tabset-fade}
-------------------------------------
### Analysis-1
```{r}
library(ggplot2)
library(ggthemes)
library(scales)
P_E_Ratio = c(12.81,15.37,15.67,26.18,39.63,90.63,0)
Sym = c("VZ","T","CM","TM","DS","NF","SP")
Vol = c(9.92, 26.04, 18.94, 3.30, 7.32, 5.6, 3.1)
metrics2 = data.frame(P_E_Ratio, Sym, Vol)
library(dplyr)
p<-ggplot(data=metrics2, aes(x=Sym, y=P_E_Ratio, fill = Sym)) +
geom_bar(stat="identity")+
geom_text(aes(label=Vol), vjust=-0.3, size=3.5)+
theme_minimal()+
xlab("Company Tickers") +
ylab("P_E_Ratio") +
ggtitle("Price to per Share Earning Ratio for Comminication Service Sector")
p
```
### Analysis-2
```{r}
p<-ggplot(data=metrics2, aes(x=Sym, y=Vol, fill = Sym)) +
geom_bar(stat="identity")+
geom_text(aes(label=Vol), vjust=-0.3, size=3.5)+
theme_minimal()+
xlab("Company Tickers") +
ylab("Volume in Million") +
ggtitle("Total Shares Sold in a day")
p
```
# Stock Trend
Row
-------------------------------------
### Chart 1
The dygraphs is a fast, flexible open source JavaScript charting library.It allows users to explore and interpret dense data sets.It provides rich facilities for charting time-series data in R and and includes support for many interactive features including series/point highlighting, zooming, and panning.
Here we are generating dygraphs for all the communication sector companies highlighting stock variation over the period of 2015 - 2020. We have considered factors like High price, Low price and closing price while producing these graphs.
### Chart 2
From this analysis, we can determine that AT&T, Disney and Spotify show very high fluctuation and Verizon, Comcast, T-mobile and Netflix shows good growth over the time.
From previous and current analysis we can deduce that we will movev forward with Netflix, T-Mobile and Verizon.
Row {.tabset .tabset-fade}
-------------------------------------
### Verizon
```{r}
library(dygraphs)
getSymbols(c("VZ", "T", "CMCSA","TMUS","DIS","NFLX","SPOT"), from = "2014-01-01", auto.assign=TRUE)
dygraph(VZ[,2:4], group = "stocks") %>%
dySeries(c("VZ.Low", "VZ.Close", "VZ.High"), label = "Verizon")
```
### AT&T
```{r}
dygraph(T[,2:4], group = "stocks") %>%
dySeries(c("T.Low", "T.Close", "T.High"), label = "AT&T")
```
### Comcast
```{r}
dygraph(CMCSA[,2:4], group = "stocks") %>%
dySeries(c("CMCSA.Low", "CMCSA.Close", "CMCSA.High"), label = "COMCAST")
```
### T-Mobile
```{r}
dygraph(TMUS[,2:4], group = "stocks") %>%
dySeries(c("TMUS.Low", "TMUS.Close", "TMUS.High"), label = "T-Mobile")
```
### Disney
```{r}
dygraph(DIS[,2:4], group = "stocks") %>%
dySeries(c("DIS.Low", "DIS.Close", "DIS.High"), label = "DIS")
```
### Netflix
```{r}
dygraph(NFLX[,2:4], group = "stocks") %>%
dySeries(c("NFLX.Low", "NFLX.Close", "NFLX.High"), label = "Netflix")
```
### Spotify
```{r}
dygraph(SPOT[,2:4], group = "stocks") %>%
dySeries(c("SPOT.Low", "SPOT.Close", "SPOT.High"), label = "Spotify")
```
# Insights
Inputs {.sidebar}
-------------------------------------
### Chart 3
We are looking at the closing price variation for Verizon, Netflix and T-Mobile. For short term period we are looking at time range from Jan, 2020 to March, 2020. For each time period, we are plotting two Straw Broom chart graphs representing closing price chnages in value and percentage. We can create straw broom charts with dyRebase function.
Second set of graphs show variation daily volume i.e. measure of shares traded. We can use the geom_segment() function to chart daily volume, which uses xy points for the beginning and end of the line. Using the aesthetic color argument, we color based on the value of volume to make these data stick out.And, we can zoom in on a specific region. Using scale_color_gradient we can quickly visualize the high and low points, and using geom_smooth we can see the trend.
Row
-------------------------------------
### Short Term - Value
```{r}
tickers <- c("VZ", "NFLX","TMUS")
getSymbols(tickers)
closePrices_short <- do.call(merge, lapply(tickers, function(x) Cl(get(x))))
dateWindow_short <- c("2020-01-01", "2020-03-01")
dygraph(closePrices_short, main = "Value", group = "stock") %>%
dyRebase(value = 100) %>%
dyRangeSelector(dateWindow = dateWindow_short)
```
### Short Term - Percentage Change
```{r}
dygraph(closePrices_short, main = "Percent", group = "stock") %>%
dyRebase(percent = TRUE) %>%
dyRangeSelector(dateWindow = dateWindow_short)
```
Row
-------------------------------------
### Daily Volume Trading : T-Mobile
```{r}
library(xts)
library(zoo)
library(PerformanceAnalytics)
library(lubridate)
library(TTR)
library(tidyverse)
library(tidyquant)
library(ggplot2)
data("FANG")
TMUS <- tq_get("TMUS", get = "stock.prices", from = "2015-09-01", to = "2016-12-31")
NFLX <- tq_get("NFLX", get = "stock.prices", from = "2015-01-01", to = "2020-06-01")
end <- as_date("2016-12-31")
start <- end - weeks(24)
TMUS %>%
filter(date >= start - days(50)) %>%
ggplot(aes(x = date, y = volume)) +
geom_segment(aes(xend = date, yend = 0, color = volume)) +
geom_smooth(method = "loess", se = FALSE) +
labs(title = "TMUS Bar Chart",
subtitle = "Charting Daily Volume, Zooming In",
y = "Volume", x = "") +
coord_x_date(xlim = c(start, end)) +
scale_color_gradient(low = "red", high = "darkblue") +
theme_tq() +
theme(legend.position = "none")
```
### Daily Volume Trading - Netflix
```{r}
start <- end - weeks(24)
NFLX %>%
filter(date >= start - days(50)) %>%
ggplot(aes(x = date, y = volume)) +
geom_segment(aes(xend = date, yend = 0, color = volume)) +
geom_smooth(method = "loess", se = FALSE) +
labs(title = "NFLX Bar Chart",
subtitle = "Charting Daily Volume, Zooming In",
y = "Volume", x = "") +
coord_x_date(xlim = c(start, end)) +
scale_color_gradient(low = "red", high = "darkblue") +
theme_tq() +
theme(legend.position = "none")
```
# Additional Insights
Column
-------------------------------------
### Stock Price Variation: T-Mobile
```{r}
library(plotly)
tmus <- getSymbols("TMUS", auto.assign = F)
dat <- as.data.frame(tmus)
dat$date <- index(tmus)
dat <- subset(dat, date >= "2016-01-01")
names(dat) <- sub("^TMUS\\.", "", names(dat))
fig <- plot_ly(dat, x = ~date, xend = ~date, color = ~Close > Open,
colors = c("red", "forestgreen"), hoverinfo = "none")
fig <- fig %>% add_segments(y = ~Low, yend = ~High, size = I(1))
fig <- fig %>% add_segments(y = ~Open, yend = ~Close, size = I(3))
fig <- fig %>% layout(showlegend = FALSE, yaxis = list(title = "Price"))
fig <- fig %>% rangeslider()
fig
```
### Stock Price Variation: Netflix
```{r}
nflx <- getSymbols("NFLX", auto.assign = F)
dat <- as.data.frame(nflx)
dat$date <- index(nflx)
dat <- subset(dat, date >= "2016-01-01")
names(dat) <- sub("^NFLX\\.", "", names(dat))
fig <- plot_ly(dat, x = ~date, xend = ~date, color = ~Close > Open,
colors = c("red", "forestgreen"), hoverinfo = "none")
fig <- fig %>% add_segments(y = ~Low, yend = ~High, size = I(1))
fig <- fig %>% add_segments(y = ~Open, yend = ~Close, size = I(3))
fig <- fig %>% layout(showlegend = FALSE, yaxis = list(title = "Price"))
fig <- fig %>% rangeslider()
fig
```