Basic Info

row

Key Metrics

Stock Price

Row

McDonald’s

Chipotle

Wendy’s

Starbucks

Returns

Row

Monthly Return

Row

McDonald’s

Chipotle

Wendy’s

Starbucks

Conclusion

Column

Financial data for 4 QSR companies (Mcdonald’s, Chipotle, Wendy’s, Starbucks) have been showcased and analyzed in this dashboard.

Judging from on the Basic Info tab, Chipotle has the highest P/E ratio and P/E Estmate Next Year, meaning we could anticipate highest growth in the future.

The Stock Price tab shows that all four companies have upward trends in stocks, while Chipotle proves to be most stable.

Lastly, based on the Returns tab, we could tell that Chipotle has the highest monthly returns in May 2018. The other 3 fluctuate within similar range while Mcdonald’s seems to have less fluctuation. In terms of daily returns, Chipotle generates highest daily return yet it also has relatively high daily loss. Mcdonald’s has high daily return as well and its daily loss comes in as the lowest.

In conclusion, I would recommend buying Chipotle’s stock given better performance. Mcdonald’s could also be a low-risk option.

---
title: "ANLY 512 Lab 1"
author: "Quning Chen"
date: "11/5/2019"
output:
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: scroll
    source_code: embed
---

Basic Info {data-orientation=rows}
=====================================

```{r setup, include=FALSE}
library(flexdashboard)
library(pdfetch)
library(dygraphs)
library(xts)
library(quantmod)
library(dplyr)
library(DT)
```


row {}
-----------------------------------------------------------------------

### Key Metrics

```{r}
tickers <- c("MCD", "CMG", "WEN", "SBUX")
symbol <- getSymbols(tickers, src = 'yahoo', auto.assign = TRUE, warnings = FALSE, from = '2017-11-01')
metrics <- getQuote(paste(tickers,sep="",collapse=";"),
                    what=yahooQF(c("P/E Ratio",
                                   "Price/EPS Estimate Next Year",
                                   "200-day Moving Average",
                                   "Average Daily Volume",
                                   "Dividend Yield",
                                   "Market Capitalization")))
DT::datatable(metrics[-1])
```


Stock Price
=====================================

Row {.tabset .tabset-fade}
-----------------------------------------------------------------------

### McDonald's


```{r}
tickers <- c("MCD", "CMG", "WEN", "SBUX")
symbol <- getSymbols(tickers, src = 'yahoo', auto.assign = TRUE, warnings = FALSE, from = '2017-11-01')
MCD <- MCD[,1:4]
CMG <- CMG[,1:4]
WEN <- WEN[,1:4]
SBUX <- SBUX[,1:4]

dygraph(MCD, main = "McDonald's Stock Price") %>% 
  dyCandlestick() %>% 
  dyAxis("y", label="Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set2")) %>%
  dyHighlight(highlightCircleSize = 4,
              highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 55)%>% 
  dyLegend(show = "onmouseover")


```


###  Chipotle

```{r}

dygraph(CMG, main = "Chipotle Stock Price") %>% 
  dyCandlestick() %>% 
  dyAxis("y", label="Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set2")) %>%
  dyHighlight(highlightCircleSize = 4,
              highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 55)%>% 
  dyLegend(show = "onmouseover")


```

###  Wendy's

```{r}

dygraph(WEN, main = "Wendy's Stock Price") %>% 
  dyCandlestick() %>% 
  dyAxis("y", label="Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set2")) %>%
  dyHighlight(highlightCircleSize = 4,
              highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 55)%>% 
  dyLegend(show = "onmouseover")


```

###  Starbucks

```{r}

dygraph(SBUX, main = "Starbucks Stock Price") %>% 
  dyCandlestick() %>% 
  dyAxis("y", label="Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set2")) %>%
  dyHighlight(highlightCircleSize = 4,
              highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 55)%>% 
  dyLegend(show = "onmouseover")


```


Returns {data-orientation=rows}
=====================================

Row {}
-----------------------------------------------------------------------

### Monthly Return


```{r}
m.rt.MCD <- monthlyReturn(MCD)
m.rt.CMG <- monthlyReturn(CMG)
m.rt.WEN <- monthlyReturn(WEN)
m.rt.SBUX <- monthlyReturn(SBUX)

mg.return <- merge.xts(m.rt.MCD,m.rt.CMG, m.rt.WEN, m.rt.SBUX)
colnames(mg.return) <- c("McDonalds",'Chipotle',"Wendys",'Starbucks')


dygraph(mg.return, main = "Monthly Return") %>%
  dyAxis("y", label = "Return") %>%
  dyOptions(colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
  dyHighlight(highlightSeriesBackgroundAlpha = 0.5,
               highlightSeriesOpts = list(strokeWidth = 4)) %>%
  dyRangeSelector(height = 55)
  
```


Row {.tabset .tabset-fade}
-----------------------------------------------------------------------

### McDonald's


```{r, message=FALSE, warning=FALSE}
tickers <- c("MCD", "CMG", "WEN", "SBUX")
symbol <- getSymbols(tickers, src = 'yahoo', auto.assign = TRUE, warnings = FALSE, from = '2017-11-01')

MCD_return<-dailyReturn(MCD$MCD.Adjusted)
plot(MCD_return, xlab="Time",ylab = "Return",main = "McDonald's Daily Return")
```


### Chipotle


```{r, message=FALSE, warning=FALSE}
CMG_return<-dailyReturn(CMG$CMG.Adjusted)
plot(CMG_return, xlab="Time",ylab = "Return",main = "Chipotle Daily Return")
```


### Wendy's


```{r, message=FALSE, warning=FALSE}
WEN_return<-dailyReturn(WEN$WEN.Adjusted)
plot(WEN_return, xlab="Time",ylab = "Return",main = "Wendy's Daily Return")
```


### Starbucks


```{r, message=FALSE, warning=FALSE}
SBUX_return<-dailyReturn(SBUX$SBUX.Adjusted)
plot(SBUX_return, xlab="Time",ylab = "Return",main = "Starbucks Daily Return")
```



Conclusion
=====================================


Column {data-width=600}
-------------------------------------

###
Financial data for 4 QSR companies (Mcdonald's, Chipotle, Wendy's, Starbucks) have been showcased and analyzed in this dashboard.

Judging from on the Basic Info tab, Chipotle has the highest P/E ratio and P/E Estmate Next Year, meaning we could anticipate highest growth in the future.

The Stock Price tab shows that all four companies have upward trends in stocks, while Chipotle proves to be most stable.

Lastly, based on the Returns tab, we could tell that Chipotle has the highest monthly returns in May 2018. The other 3 fluctuate within similar range while Mcdonald's seems to have less fluctuation. In terms of daily returns, Chipotle generates highest daily return yet it also has relatively high daily loss. Mcdonald's has high daily return as well and its daily loss comes in as the lowest.

In conclusion, I would recommend buying Chipotle's stock given better performance. Mcdonald's could also be a low-risk option.