This dashboard explores the following 4 companies and their stock values:
Tesla, Ford Motor, Volkswagen, and Toyota Motor.
To conduct a thorough analysis of these 4 stock companies, the following metrics will be considered:
Price EPS Estimate Next Year, PEG Ratio, Dividend Yield, and Market Capitalization.
[1] "TSLA" "F" "VWAGY" "TM"
The figures above illustrate the stock prices of each company from 1/1/2022 to 1/1/2023. It is clear to see that amongst the four companies, Toyota and Tesla closed higher prices 146.15 and 144.43 respectively. Furthermore, the volume shows us the number of shares of security traded which indicates the significance the market move. Above, we can see that Tesla has the highest volume of shares followed by Ford.
I performed a thorough analysis of the four automotive companies (Tesla, Ford, Volkswagen, and Toyota) using their stock market data. I took into account the companies stock volumes, opening, closing, high and low prices and used those results to compare which company would be better to invest in and provide a short term gain. Toyota followed by Tesla had the highest closing prices while Tesla followed by Ford had the highest volume fo shares. I also took a look into the companies Price/EPS Estimate Next Year, PEG Ratio, Dividend Yield, and Market Capitalization. Here I found that Tesla had the highest number in all of these metrics except Dividend Yield. Overall, when taking at the analysis performed with the various stock metrics I believe that investing in Tesla would be the best way to produce the most short term gain.
---
title: "Stock Company Analysis"
author: "Belosan W Jekale"
date: "2023-01-26"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
source_code: embed
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Introduction
## row {data-height=150}
### Introduction
This dashboard explores the following 4 companies and their stock values:
Tesla, Ford Motor, Volkswagen, and Toyota Motor.
To conduct a thorough analysis of these 4 stock companies, the following metrics will be considered:
Price EPS Estimate Next Year, PEG Ratio, Dividend Yield, and Market Capitalization.
```{r packages, echo=FALSE}
#install.packages("flexdashboard", type = "source")
library(flexdashboard)
#install.packages("quantmod")
library(quantmod)
library(plyr)
#install.packages("xts")
library(xts)
library(dplyr)
#install.packages("dygraphs")
library(dygraphs)
#install.packages("DT")
library(DT)
#install.packages("ggplot2")
library(ggplot2)
```
## row
### Summary Table
```{r dataIn, echo=FALSE}
what_metrics <- yahooQF(c("Price/Sales",
"P/E Ratio",
"Price/EPS Estimate Next Year",
"PEG Ratio",
"Dividend Yield",
"Market Capitalization"))
tickers <- c("TSLA", "F", "VWAGY", "TM")
getSymbols(tickers, from = '2021-12-31')
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=what_metrics)
metrics <- data.frame(Symbol=tickers, metrics[,2:length(metrics)])
colnames(metrics) <- c("Symbol", "Price EPS Estimate Next Year", "PEG Ratio", "Dividend Yield", "Market Capitalization")
write.csv(metrics, "FinancialMetrics.csv", row.names=FALSE)
DT::datatable(metrics)
```
# Metrics
## Column{.sidebar}
In order to compare the different automotive companies, four key metrics need to be compared.
1. Price/EPS Estimate Next year:
This metric focuses on the Earnings per share. The greater the EPS, the better the profitability of the company. As shown on the right, Tesla has the highest EPS, followed by Toyota.
2. PEG Ratio:
This metric takes into account today's earnings and the expected growth rate and tells us whether a stocks price is over or under valued. A higher PEG Ratio may indicate that the company is overvalued and the stock price may be too high.
3. Dividend Yield:
This metric looks into whether the stock companies are giving back to their investors. Although this may seem like a higher dividend yield would mean a quick gain, this is not true. Since Dividend Yield changes when stock prices change it be high when the stock prices are depreciating. Volkswagen has the highest dividend yeild but that does not mean it would be the best company to invest in to get a short term gain.
4. Market Capitalization:
This metric focuses on the company size. The Market cap tells us how established a company is and the extent of its history in business. The greater that Market Cap, the safer it is to invest in the company. As shown on the right, Tesla has the highest Market Cap, followed by Toyota.
## row
### Price EPS Estimate Next Year
```{r Price EPS Estimate Next Year, echo=FALSE}
metrics <- data.frame(metrics)
ggplot(metrics, aes(x = Symbol, y = Price.EPS.Estimate.Next.Year, fill = Symbol)) +
geom_bar(stat="identity") +
theme_classic() +
theme(legend.position="none") +
scale_fill_manual(
values = c("grey", "grey", "black", "grey")
)+
labs(x = "Company",
y = "Price/EPS Estimate Next Year",
title = "Price/EPS Estimate Next Year per Company")
```
### PEG Ratio
```{r PEG Ratio, echo=FALSE}
ggplot(metrics, aes(x = Symbol, y = PEG.Ratio, fill = Symbol)) +
geom_bar(stat="identity") +
theme_classic() +
theme(legend.position="none") +
scale_fill_manual(
values = c("grey", "grey", "black", "grey")
)+
labs(x = "Company",
y = "PEG Ratio",
title = "PEG Ratio Per Company")
```
## row
### Dividend Yield
```{r Dividend Yield, echo=FALSE}
ggplot(metrics, aes(x = Symbol, y = Dividend.Yield, fill = Symbol)) +
geom_bar(stat="identity") +
theme_classic() +
theme(legend.position="none") +
scale_fill_manual(
values = c("grey", "grey", "grey", "black")
)+
labs(x = "Company",
y = "Dividend Yield",
title = "Dividend Yield Per Company")
```
### Market Capitalization
```{r Market Capitalization, echo=FALSE}
ggplot(metrics, aes(x = Symbol, y = Market.Capitalization, fill = Symbol)) +
geom_bar(stat="identity") +
theme_classic() +
theme(legend.position="none") +
scale_fill_manual(
values = c("grey", "grey", "black", "grey")
)+
labs(x = "Company",
y = "Market Capitalization",
title = "Market Capitalization Per Company")
```
# Stock Prices
## column {.tabset .tabset-fade}
### Tesla
```{r tesla, echo=FALSE}
tesla <- tail(TSLA, n = 365)
dygraph(tesla, main = 'Tesla Stock Prices') %>%
dyCandlestick() %>%
dyOptions(stackedGraph = TRUE) %>%
dyRangeSelector(height = 20) %>%
dySeries("TSLA.Open", label = "Open") %>%
dySeries("TSLA.High", label = "High") %>%
dySeries("TSLA.Low", label = "Low") %>%
dySeries("TSLA.Close", label = "Close") %>%
dySeries("TSLA.Volume", label = "Volume") %>%
dySeries("TSLA.Adjusted", label = "Adjusted") %>%
dyAxis("x", label = "Date", drawGrid = FALSE) %>%
dyAxis("y", label = "Stock Prices") %>%
dyOptions(axisLineWidth = 1.5)
```
### Ford
```{r ford, echo=FALSE}
ford <- tail(F, n = 365)
dygraph(ford, main = 'Ford Stock Prices') %>%
dyCandlestick() %>%
dyRangeSelector(height = 20) %>%
dySeries("F.Open", label = "Open") %>%
dySeries("F.High", label = "High") %>%
dySeries("F.Low", label = "Low") %>%
dySeries("F.Close", label = "Close") %>%
dySeries("F.Volume", label = "Volume") %>%
dySeries("F.Adjusted", label = "Adjusted") %>%
dyAxis("x", label = "Date", drawGrid = FALSE) %>%
dyAxis("y", label = "Stock Prices") %>%
dyOptions(axisLineWidth = 1.5)
```
### Volkswagen
```{r vm, echo=FALSE}
volkswagen <- tail(VWAGY, n = 365)
dygraph(volkswagen, main = 'Volkswagen Stock Prices') %>%
dyCandlestick() %>%
dyRangeSelector(height = 20) %>%
dySeries("VWAGY.Open", label = "Open") %>%
dySeries("VWAGY.High", label = "High") %>%
dySeries("VWAGY.Low", label = "Low") %>%
dySeries("VWAGY.Close", label = "Close") %>%
dySeries("VWAGY.Volume", label = "Volume") %>%
dySeries("VWAGY.Adjusted", label = "Adjusted") %>%
dyAxis("x", label = "Date", drawGrid = FALSE) %>%
dyAxis("y", label = "Stock Prices") %>%
dyOptions(axisLineWidth = 1.5)
```
### Toyota
```{r toyota, echo=FALSE}
toyota <- tail(TM, n = 365)
dygraph(toyota, main = 'Toyota Stock Prices') %>%
dyCandlestick() %>%
dyRangeSelector(height = 20) %>%
dySeries("TM.Open", label = "Open") %>%
dySeries("TM.High", label = "High") %>%
dySeries("TM.Low", label = "Low") %>%
dySeries("TM.Close", label = "Close") %>%
dySeries("TM.Volume", label = "Volume") %>%
dySeries("TM.Adjusted", label = "Adjusted") %>%
dyAxis("x", label = "Date", drawGrid = FALSE) %>%
dyAxis("y", label = "Stock Prices") %>%
dyOptions(axisLineWidth = 1.5)
```
## row {data-height=100}
### Footnote
The figures above illustrate the stock prices of each company from 1/1/2022 to 1/1/2023. It is clear to see that amongst the four companies, Toyota and Tesla closed higher prices 146.15 and 144.43 respectively. Furthermore, the volume shows us the number of shares of security traded which indicates the significance the market move. Above, we can see that Tesla has the highest volume of shares followed by Ford.
# Conclusion
## Conclusion
I performed a thorough analysis of the four automotive companies (Tesla, Ford, Volkswagen, and Toyota) using their stock market data. I took into account the companies stock volumes, opening, closing, high and low prices and used those results to compare which company would be better to invest in and provide a short term gain. Toyota followed by Tesla had the highest closing prices while Tesla followed by Ford had the highest volume fo shares. I also took a look into the companies Price/EPS Estimate Next Year, PEG Ratio, Dividend Yield, and Market Capitalization. Here I found that Tesla had the highest number in all of these metrics except Dividend Yield. Overall, when taking at the analysis performed with the various stock metrics I believe that investing in Tesla would be the best way to produce the most short term gain.