.navbar { background-color:lightgrey; border-color:black; } .navbar-brand { color:black!important; }
The purpose of this dashboard is to provide end-user with a central resource to present information necessary to support day-to-day decision pertaining to investments in company stocks. Four companies stocjs & finacial information will be visualized to make a coherent decision.
The objective is to plan, design, and create an information dashboard to support quantitative decision making.
Objesctives listed: 1.Delineate the necessary decision. 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 to be made is to purchase securities/commodities for the key objective of maximizing profits. Investment in4 pharma companies is being considered:
1.Merck 2.IQVIA 3.Johnson & Jonhson 4.Pfizer
I am pulling financial data from Yahoo Finnance.
Below is the summary table for the kep financial metrics taken for evaluating all the four companies performances - Merck, IQVIA, Johnson & Jonhson (JnJ), Pfizer. All these companies operate wihitn the pharmacuetical industry. The reason to chose these specific companies are due to them beign the industry leaders in terms of product development and innovation. It will be helpful in understanding at what place they stand in terms of profits as well as to chose for us to invest in for short term gains.
We can see that P-E ratio of IQVIA is high in compared to others and highest in EPS. Since P-E ratio plays a major role in attracting investors it might have greater risk when it’s stock price starts fluctuating. Coming to the market cap, JnJ stands at top place as it has high worth in the market which investors might be looking at it currently. Pfizer has the highest dividend yield.
[1] "MRK"
[1] "IQV"
[1] "JNJ"
[1] "PFE"
In addition to the individual stock analysis, below is the comparison of their Monthly return in one combined plot.
From the individual stock rates and monthly return, I would prefer to invest for short term gain would be MERCK and second on PFIZER.
---
title: "ANLY 512 Lab1"
author: "Subhan Khalid"
date: "01/14/2023"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: menu
source: embed
vertical_layout: fill
pdf_document: default
html_document:
df_print: paged
---
.navbar {
background-color:lightgrey;
border-color:black;
}
.navbar-brand {
color:black!important;
}
# Conclusion {.sidebar}
**Table of Contents:**
* Agenda
Overview
Objective
The Decision & Rules
Methods Help
* Key Indicator Analysis
Metrics
Metric Analysis
* Individual Stock Analysis
Companys Stocks Performances
* Monthly Return Comparision
* Conclusion
# **Agenda**
Row {data-height=250}
-------------------------------------
### **Overview**
The purpose of this dashboard is to provide end-user with a central resource to present information necessary to support day-to-day decision pertaining to investments in company stocks. Four companies stocjs & finacial information will be visualized to make a coherent decision.
Row
-------------------------------------
### **Objective**
The objective is to plan, design, and create an information dashboard to support quantitative decision making.
Objesctives listed:
1.Delineate the necessary decision.
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**
The decision to be made is to purchase securities/commodities for the key objective of maximizing profits. Investment in4 pharma companies is being considered:
1.Merck
2.IQVIA
3.Johnson & Jonhson
4.Pfizer
### **Methods Help**
##### *Getting data*
I am pulling financial data from Yahoo Finnance.
# **Key Indicator Analysis**
Row {data-height=200}
-------------------------
### **Financial Indicators/Metrics**
+ `r kableExtra::text_spec("**P-E Ratio**", color = "#5c5c5c")` - It is the ratio of a company's share price to the company's earnings per share. This ratio is used for valuing companies and to find out whether they are overvalued or undervalued.
+ `r kableExtra::text_spec("**EPS**", color = "#5c5c5c")` - It is the portion of a company's profit that is allocated to every individual share of the stock and helps in understanding the financial strength of a company
+ `r kableExtra::text_spec("**Dividend Yield Ratio**", color = "#5c5c5c")` - 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 = "#5c5c5c")` - the total value of a company's shares.
Row {data-height=200}
-------------------------
### **Key Indicator Analysis at a glance**
Below is the summary table for the kep financial metrics taken for evaluating all the four companies performances - Merck, IQVIA, Johnson & Jonhson (JnJ), Pfizer. All these companies operate wihitn the pharmacuetical industry. The reason to chose these specific companies are due to them beign the industry leaders in terms of product development and innovation. It will be helpful in understanding at what place they stand in terms of profits as well as to chose for us to invest in for short term gains.
We can see that P-E ratio of IQVIA is high in compared to others and highest in EPS. Since P-E ratio plays a major role in attracting investors it might have greater risk when it's stock price starts fluctuating. Coming to the market cap, JnJ stands at top place as it has high worth in the market which investors might be looking at it currently. Pfizer has the highest dividend yield.
```{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", type = "binary")
#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")
#install.packages("flexdashboard", repos = "http://cran.us.r-project.org")
#install.packages("glue")
#install.packages("lifecycle")
#install.packages("rlang")
#install.packages("acepack")
#install.packages("latticeExtra")
#install.packages("flexdashboard", type = "binary")
#install.packages("kableExtra", type = "binary")
#install.packages("htmltools")
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)
library(flexdashboard)
```
Row
-------------------------
```{r}
library(plyr)
what_metrics <- yahooQF(c("Price/Sales",
"P/E Ratio",
"Price/EPS Estimate Next Year",
"PEG Ratio",
"Dividend Yield",
"Market Capitalization"))
tickers <- c("MRK", "IQV", "JNJ", "PFE")
metrics <- getQuote(paste(tickers, sep = ",", collapse = ";"), what = what_metrics)
metrics <- data.frame(Symbol = tickers, metrics[,2:length(metrics)])
DT::datatable(metrics)
```
# **Individual Stock Analysis**
#### **Stocks**
```{r, echo=FALSE}
getSymbols("MRK", from = "2022-01-01", to = "2023-01-1")
MRKlog <- MRK %>% Ad() %>% dailyReturn(type = 'log')
getSymbols("IQV", from = "2022-01-01",to = "2023-01-1")
IQVlog <- IQV %>% Ad() %>% dailyReturn(type = 'log')
getSymbols("JNJ", from = "2022-01-01",to = "2023-01-1")
JNJlog <- JNJ %>% Ad() %>% dailyReturn(type = 'log')
getSymbols("PFE", from = "2022-01-01",to = "2023-01-1")
PFElog <- PFE %>% Ad() %>% dailyReturn(type = 'log')
```
Row {.tabset .tabset-fade}
-------------------------------------
### MERCK
```{r}
MRK %>% Ad() %>% chartSeries()
MRK %>% chartSeries(TA = 'addBBands();addVo();addMACD()',subset='2022')
```
### IQVIA
```{r}
IQV %>% Ad() %>% chartSeries()
IQV %>% chartSeries(TA = 'addBBands();addVo();addMACD()',subset='2022')
```
### JnJ
```{r}
JNJ %>% Ad() %>% chartSeries()
JNJ %>% chartSeries(TA = 'addBBands();addVo();addMACD()',subset='2022')
```
### PFIZER
```{r}
PFE %>% Ad() %>% chartSeries()
PFE %>% chartSeries(TA = 'addBBands();addVo();addMACD()',subset='2022')
```
Monthly Return Comparison & Conclusion
=====================================
Row {data-height=850}
-------------------------------------
### **Monthly Return Comparison**
In addition to the individual stock analysis, below is the comparison of their Monthly return in one combined plot.
```{r}
MRKmr <- monthlyReturn(MRK)
IQVmr <- monthlyReturn(IQV)
JNJmr <- monthlyReturn(JNJ)
PFEmr <- monthlyReturn(PFE)
mg.return <- merge.xts(MRKmr, IQVmr, JNJmr, PFEmr)
colnames(mg.return) <- c("MERCK", "IQVIA", "JnJ", "PFIZER")
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)
```
Row {data-height=150}
-------------------------------------
### **Conclusion**
From the individual stock rates and monthly return, I would prefer to invest for short term gain would be MERCK and second on PFIZER.