Introduction

row

Introduction

When faced with the task of making a quantitative choice, many people report feeling overwhelmed by the sheer volume of data at their disposal. It is common for analysts to perform analyses or develop instruments to aid in quantitative decision making. The information dashboard is a primary instrument used in business, government, nonprofits, and universities to deal with information overload. The purpose of a dashboard is to provide users with a consolidated view of all relevant data for making decisions and running activities on a daily basis. ## row

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.Explain in detail the option you must choose. 2.Figure out what data will be useful for making choices. 3.Locate and assemble the information you’ll need to construct your display strategy. 4.Classify and outline the information gathered. 5.Conceive of the most effective graphic representations for displaying the data, and make them. 6.Arrange the visualizations’ layout in a manner that is consistent with dashboard theory. 7.Summarize the outcomes of your analysis and the images you created.

Decision

Objective is to purchase securities/commodities for the key objective of maximizing profits.I’m considering investing in one of these four companies Apple (APPL), Nvdia (NVDA), Tesla (TSLA) Google(GOOGL).

Overview

Row

financial indicators

P-E Ratio - ratio of a company’s share price to it’s earnings per share. EPS - portion of a company’s profit allocated to every individual share. Dividend Yield Ratio - ratio that shows how much a company pays out in dividends each year relative to its stock price. Market Cap - the total value of a company’s shares.

Key Indicator Analysis

Overall daily trend

column

overall daily trend

[1] "AAPL"  "GOOGL" "NVDA"  "TSLA" 

Facet Chart

Individual stock price trend

column

AAPL

Googl

NVDA

TSLA

Monthly return analysis

monthly return analysis

Conclusion

Apple, Google, Nvdia, and tesla were evaluated using a number of metrics we developed (P/E Ratio, EPS, Dividend Yield, Market Cap) from September 2022 through March 2023. Based on the data, i conclude:

Nvdia P-E Ratio (112.3) is higher than Tesla (52.4), apple (26.7), and Google (22.8), indicating that investors anticipate Nvdia to generate higher profits.

EPS: Nvdia has the highest EPS, which shows how much money a company makes for each share of stock (43.9) followed by tesla(34.5) Apple(23.9) and google(16.5).

Only apple (0.5%) and Nvdia (0.06%) offers a dividend return, apple is the better option for dividend investors.

Apple has highest market cap followed by Google, Nvdia and tesla

I made graphs showing how the market as a whole, specific stocks, and the monthly yield all compare. From the generated logs of individual stock rates and monthly return comparison, My first preference to invest for short term gain would be Nvdia and second on apple.

---
title: "ANLY 512 - Lab 1"
author: "Sai Priya Kallepalli"
date: "3/28/2023"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    social: menu
    source: embed
    html_document:
    df_print: paged
    pdf_document: default
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Table of Contents {.sidebar}

\* Introduction
  
\* Overview                          
  
\* Company's Stocks Performances Detail

\* Conclusion

# Introduction

## row {data-height=230}

### Introduction

When faced with the task of making a quantitative choice, many people report feeling overwhelmed by the sheer volume of data at their disposal. It is common for analysts to perform analyses or develop instruments to aid in quantitative decision making. The information dashboard is a primary instrument used in business, government, nonprofits, and universities to deal with information overload. The purpose of a dashboard is to provide users with a consolidated view of all relevant data for making decisions and running activities on a daily basis.
## row

### 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.Explain in detail the option you must choose.
2.Figure out what data will be useful for making choices.
3.Locate and assemble the information you'll need to construct your display strategy.
4.Classify and outline the information gathered.
5.Conceive of the most effective graphic representations for displaying the data, and make them.
6.Arrange the visualizations' layout in a manner that is consistent with dashboard theory.
7.Summarize the outcomes of your analysis and the images you created.

### Decision 

Objective is to purchase securities/commodities for the key objective of maximizing profits.I'm considering investing in one of these four companies Apple (APPL), Nvdia (NVDA), Tesla (TSLA) Google(GOOGL).  

# Overview

## Row {data-width=230}

### financial indicators


P-E Ratio - ratio of a company's share price to it's earnings per share. 
EPS - portion of a company's profit allocated to every individual share. 
Dividend Yield Ratio - ratio that shows how much a company pays out in dividends each year relative to its stock price.
Market Cap - the total value of a company's shares.

### Key Indicator Analysis


```{r echo=FALSE, warning=FALSE, message=FALSE}
library(dygraphs)
library(quantmod)
library(plyr)
library(DT)
library(dplyr)
library(highcharter)
library(viridisLite)
library(ggplot2)
library(broom)
library(xts)
library(zoo)
what_metrics <- yahooQF(c("Price/Sales", 
                          "P/E Ratio",
                          "Price/EPS Estimate Next Year",
                          "PEG Ratio",
                          "Dividend Yield", 
                          "Market Capitalization"))
tickers <- c("AAPL", "GOOGL", "NVDA", "TSLA")
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", "EPS", "Dividend Yield Ratio", "Market Cap")
DT::datatable(metrics)


```

# Overall daily trend

## column {data-height=650 .tabset .tabset-fade}

### overall daily trend {data-width=630}

```{r echo=FALSE, warning=FALSE, message=FALSE}
start <- as.Date("2022-09-15") 
end <- as.Date("2023-03-15")

getSymbols(tickers, src = "yahoo", from = start, to = end)
stocks = as.xts(data.frame(A = AAPL[, "AAPL.Adjusted"], 
B = GOOGL[, "GOOGL.Adjusted"], C = NVDA[, "NVDA.Adjusted"], 
E = TSLA[,"TSLA.Adjusted"]))
```

```{r echo=FALSE, warning=FALSE, message=FALSE}

names(stocks) <- c("AAPL", "GOOGL", "NVDA","TSLA")
index(stocks) <- as.Date(index(stocks))

stocks_series <- tidy(stocks) %>% 
  
  ggplot(aes(x=index,y=value, color=series)) +
  labs(title = "Daily Stock Adjusted Prices Comparison from 09/2022-03/2023",
       
       subtitle = "Among Apple, Google, Nvdia, Tesla",
       caption = " Source: Yahoo Finance",
       color = "Stock",
       x = "Date",
       y = "End of day Adjusted Price ($)") +
  scale_color_manual(values = c("Red", "Green", "DarkBlue","Orange"))+
  geom_line()

stocks_series

```

###  Facet Chart {data-width=630}

```{r echo=FALSE, warning=FALSE, message=FALSE}

stocks_series2 = tidy(stocks) %>% 
  
  ggplot(aes(x=index,y=value, color=series)) + 
  geom_line() +
  facet_grid(series~.,scales = "free") + 
  labs(title = "Daily Stock Adjusted Prices Comparison from 09/2022-03/2023",
       
       subtitle = "Among Apple, Google, Nvdia, Tesla",
       caption = " Source: Yahoo Finance",
       color = "Stock",
       x = "Date",
       y = "End of day Adjusted Price ($)") +
  scale_color_manual(values = c("Red", "Green", "DarkBlue","Orange"))
stocks_series2

```

# Individual stock price trend

## column {data-height=330 .tabset .tabset-fade}

### AAPL {data-width=330}

```{r echo=FALSE, warning=FALSE, message=FALSE}
### Alibaba {data-width=500}
ma7_AAPL <- SMA(Ad(AAPL), 7) 
ma14_AAPL <- SMA(Ad(AAPL), 14) 
close_AAPL <- AAPL$AAPL.Close

all_AAPL <- cbind(ma7_AAPL, close_AAPL, ma14_AAPL)
colnames(all_AAPL) <- c('7-days MA','Close','14-days MA')

dygraph(all_AAPL, main = "Price Vs Moving Average AAPL") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)


```

### Googl {data-width=330}

```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_GOOGL <- SMA(Ad(GOOGL), 7) 
ma14_GOOGL <- SMA(Ad(GOOGL), 14) 
close_GOOGL <- GOOGL$GOOGL.Close

all_GOOGL <- cbind(ma7_GOOGL, close_GOOGL, ma14_GOOGL)
colnames(all_GOOGL) <- c('7-days MA','Close','14-days MA')

dygraph(all_GOOGL, main = "Price Vs Moving Average GOOGL") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)
```

### NVDA {data-width=330}

```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_NVDA <- SMA(Ad(NVDA), 7) 
ma14_NVDA <- SMA(Ad(NVDA), 14) 
close_NVDA <- NVDA$NVDA.Close

all_NVDA <- cbind(ma7_NVDA, close_NVDA, ma14_NVDA)
colnames(all_NVDA) <- c('7-days MA','Close','14-days MA')

dygraph(all_NVDA, main = "Price Vs Moving Average NVDA") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)
```

### TSLA {data-width=330}

```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_TSLA <- SMA(Ad(TSLA), 7) 
ma14_TSLA <- SMA(Ad(TSLA), 14) 
close_TSLA <- TSLA$TSLA.Close

all_TSLA <- cbind(ma7_TSLA, close_TSLA, ma14_TSLA)
colnames(all_TSLA) <- c('7-days MA','Close','14-days MA')

dygraph(all_TSLA, main = "Price Vs Moving Average TSLA") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)
```

# Monthly return analysis

### monthly return analysis {data-width=330}

```{r echo=FALSE, warning=FALSE, message=FALSE}
AAPLmr <- monthlyReturn(AAPL)
GOOGLmr <- monthlyReturn(GOOGL)
NVDAmr <- monthlyReturn(NVDA)
TSLAmr <- monthlyReturn(TSLA)

mg.return <- merge.xts(AAPLmr, GOOGLmr, NVDAmr, TSLAmr)
colnames(mg.return) <- c("APPLE", "GOOGLE", "NVDIA", "TESLA")

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
Apple, Google, Nvdia, and tesla were evaluated using a number of metrics we developed (P/E Ratio, EPS, Dividend Yield, Market Cap) from September 2022 through March 2023. Based on the data, i conclude:

Nvdia P-E Ratio (112.3) is higher than Tesla (52.4), apple (26.7), and Google (22.8), indicating that investors anticipate Nvdia to generate higher profits.

EPS: Nvdia has the highest EPS, which shows how much money a company makes for each share of stock (43.9) followed by tesla(34.5) Apple(23.9) and google(16.5).

Only apple (0.5%) and Nvdia  (0.06%) offers a dividend return, apple is the better option for dividend investors.

Apple has highest market cap followed by Google, Nvdia and tesla

I made graphs showing how the market as a whole, specific stocks, and the monthly yield all compare. From the generated logs of individual stock rates and monthly return comparison, My first preference to invest for short term gain would be Nvdia and second on apple.