class: center, middle, inverse, title-slide .title[ # Exploring the Effect of Google Search Trends on the Stock Prices of Different Egg Companies (an ongoing project) - 2023 CSU-POM conference ] .author[ ### Dr. Zhenning ‘Jimmy’ Xu, followe me on Twitter:
https://twitter.com/MKTJimmyxu
] .date[ ### 2023/03/08 ] --- background-image: url(https://upload.wikimedia.org/wikipedia/commons/b/be/Sharingan_triple.svg) ??? Image credit: [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Sharingan_triple.svg) --- class: center, middle # xaringan ### /ʃaː.'riŋ.ɡan/ --- class: inverse, center, middle # Get Started --- # Outline - Introduction? - Overview of the egg industry and its importance in the economy - The Efficient Marketing Hypothesis (Fama, 1970) - Why understanding Google search trends is relevant? - Explanation of the stock prices of the chicken (or egg) companies over time - Q&As --- background-image: url(https://github.com/yihui/xaringan/releases/download/v0.0.2/karl-moustache.jpg) background-position: 50% 50% class: center, bottom, inverse # You only live once! --- # Introduction - Some of the dominant Producers of eggs in the US - Tyson Foods(TSN), Cal-Maine (CALM), and General Mills - **Efficient market hypothesis** - Fama (1970) distinguishes three degrees of market efficiency: weak form efficiency, semi-strong form efficiency and strong form efficiency. - Imaging a $100 bill is lying on the ground, would you bother to pick it up? --- # Understanding the current egg prices based on published econometric models - Based on quarterly models, an avian influenza outbreak would lead to a decrease in the price of eggs from $0.03 to $0.30 per dozen (Paarlberg, Seitzinger, and Lee, 2007) - Based on yearly models, an outbreak of an avian influenza in the U.S. would result in a price increase of $0.19 per dozen (Brown, Madison, Goodwin, and Clark (2007). --- # Method & Data - Data is scraped from Yahoo Finance and Google Trends using R and its libraries such as quantmod and GtrendsR. - Quantmod is an R package that provides a suite of tools for quantitative financial modeling and analysis. It enables users to access and manipulate financial data from various sources, including Yahoo Finance. - A series of time series analysis is performed using R and its libraries such as ggplot2, forecast, and ts. --- # Analysis of Egg Shortage and Chicken Flu .center[<img src="https://raw.githubusercontent.com/utjimmyx/resources/master/chickenegg.PNG" width='100%' align="middle"/>] --- # Intro to Quantmod - The first step in using quantmod to retrieve Yahoo Finance data is to specify the ticker symbol for the stock you want to analyze. For example, if we want to retrieve data for Tyson Foods, the ticker symbol is TSN. - Once we have the ticker symbol, we can use the getSymbols() function to retrieve the data. This function downloads data from various sources, including Yahoo Finance, and returns it as an object that can be manipulated in R. - Sample syntax - getSymbols('TSN', src = 'yahoo', from = "2010-01-01", to = Sys.Date()) --- # Analysis of Egg Stock Prices - the trends in the Tyson stock prices over time .center[<img src="https://raw.githubusercontent.com/utjimmyx/resources/master/TSN_stock.PNG" width='100%' align="middle"/>] --- # Analysis of Egg Stock Prices - the trends in the Cal-Maine stock prices over time .center[<img src="https://raw.githubusercontent.com/utjimmyx/resources/master/CALM.PNG" width='100%' align="middle"/>] --- # Analysis of Egg Stock Prices - Regression analysis for the Tyson stock prices and the Cal-Maine stock prices over time .center[<img src="https://raw.githubusercontent.com/utjimmyx/resources/master/Regression.PNG" width='100%' align="middle"/>] --- # Exploring the relation between Google search trends and egg stock prices .center[<img src="https://raw.githubusercontent.com/utjimmyx/resources/master/Trends_TSN.PNG" width='100%' align="middle"/>] --- ## Thank you all for your participation! ### Questions ### References - https://www.rstudio.com/about/customer-stories/ xaringan Presentations and R - - - Markdownhttps://bookdown.org/yihui/rmarkdown/xaringan.html - Slides for today can be accessed at my Rpubs.com website [**rpubs.com**](https://rpubs.com/utjimmyx). - Intro to the quantmod package. https://www.quantmod.com/ Using R for Time Series Analysis - Intro to the package, GtrendsR - https://cran.r-project.org/web/packages/gtrendsR/gtrendsR.pdf - https://a-little-book-of-r-for-time-series.readthedocs.io/en/latest/src/timeseries.html