<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/sentiment-analysis-of-warren-buffetts-letters-to-shareholders/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://michaeltoth.me/sentiment-analysis-of-warren-buffetts-letters-to-shareholders.html"> Michael Toth's Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Last week, I was reading through Warren Buffett’s most recent letter to Berkshire Hathaway shareholders. Every year, he writes a letter that he makes <a target="_blank" rel="nofollow" href="http://www.berkshirehathaway.com/letters/letters.html">publicly available</a> on the Berkshire Hathaway website. In the letters he talks about the performance of Berkshire Hathaway and their portfolio of businesses and investments. But he also talks about his views on business, the market, and investing more generally, and it’s after this wisdom that many investors, including me, read what he has to say. </p>
<p>In many ways Warren Buffett’s letters are atypical. When most companies report their financial performance, they fill their reports with dense, technical language designed to obscure and confuse. Mr. Buffett does not follow this approach. His letters are written in easily understandable language, beacuse he wants them to be accessible to everybody. Warren Buffett is not often swayed by what others are doing. He goes his own way, and that has been a source of incredible strength. In annually compounded returns, Berkshire stock has gained 20.8% since 1965, while the S&amp;P 500 as a whole has gained only 9.7% over the same period. To highlight how truly astounding this performance is, one dollar invested in the S&amp;P in 1965 would have grown to $112.34 by the end of 2016, while the same dollar invested in Berkshire stock would have grown to the massive sum of $15,325.46!</p>
<p>I’ve been reading the annual Berkshire letters when they come out for the last few years. One day I’ll sit down and read through all of them, but I haven’t gotten around to it yet. But while I was reading through his most recent letter last week, I got to thinking. I wondered whether there are any trends in his letters over time, or how strongly his writings are influenced by external market factors. I decided I could probably answer some of these questions through a high-level analysis of the text in his letters, which brings me to the subject of this blog post. </p>
<p>In this post I’m going to be performing a sentiment analysis of the text of Warren Buffett’s letters to shareholders from 1977 – 2016. A <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Sentiment_analysis">sentiment analysis</a> is a method of identifying and quantifying the overall sentiment of a particular set of text. Sentiment analysis has many use cases, bu a common one is to determine how positive or negative a particular text document is, which is what I’ll be doing here. For this, I’ll be using <a target="_blank" rel="nofollow" href="https://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html">bing sentiment analysis</a>, developed by <a target="_blank" rel="nofollow" href="https://www.cs.uic.edu/~liub/">Bing Liu</a> of the University of Illinois at Chicago. For this type of sentiment analysis, you first split a text document into a set of distinct words, and then for each word determining whether it is positive, negative, or neutral. </p>
<p>In the graph below, I show something called the ‘Net Sentiment Ratio’ for each of Warren Buffett’s letters, beginning in 1977 and ending with 2016. The net sentiment ratio tells how positive or negative a particular text is. I’m definining the net sentiment ratio as: </p>
<p>(Number of Positive Words – Number of Negative Words) / (Number of Total Words)</p>
<p><img title="plot of chunk plotting" alt="plot of chunk plotting" src="https://i2.wp.com/michaeltoth.me/figure/berkshire_hathaway_sentiment-plotting-1.png?w=456" data-recalc-dims="1"></p>
<p>The results here show that overall, Warren Buffett’s letters have been positive. Over the forty years of letters I’m analyzing here, only 5 show a negative net sentiment score. The five years that do show negative net sentiment scores are closely tied with major negative economic events:</p>
<ul>
<li><strong>1987</strong>: The market crash that happened on October 19th, 1987 (Black Monday) is widely known as the largest single-day percentage decline ever experienced for the Dow-Jones Industrial Average, 22.61% in one day.</li>
<li><strong>1990</strong>: The recession of 1990, triggered by an oil price shock following the United States’ invasion of Kuwait, resulted in a notable increase in unemployment.</li>
<li><strong>2001</strong>: Following the 1990s, which represented the longest period of growth in American history, 2001 saw the collapse of the dot-com bubble and associated declining market values, as well as the September 11th attacks.</li>
<li><strong>2002</strong>: The market, already falling in 2001, continued to see declines throughout much of 2002.</li>
<li><strong>2008</strong>: The Great Recession was a large worldwide economic recession, characterized by the International Monetary Fund as the worst global recession since before World War II. Other related events during this period included the financial crisis of 2007-2008 and the subprime mortgage crisis of 2007-2009.</li>
</ul>
<p>Another interesting topic to examine is which words were actually the strongest contributors to the positive and negative sentiment in the letters. For this exercise, I analyzed the letters as one single text, and present the most common positive and negative words in the graph below.</p>
<p><img title="plot of chunk sentiment_list" alt="plot of chunk sentiment_list" src="https://i1.wp.com/michaeltoth.me/figure/berkshire_hathaway_sentiment-sentiment_list-1.png?w=456" data-recalc-dims="1"></p>
<p>The results here are interesting. Many of the most common words–‘gain’, ‘gains’, ‘loss’, ‘losses’, ‘worth’, ‘liability’, and ‘debt’–are what we’d expect given the financial nature of these documents. I find the adjectives that make their way into this set particularly interesting, as they give insight into the way Warren Buffett thinks. On the positive side we have ‘significant’, ‘outstanding’, ‘excellent’, ‘extraordinary’, and ‘competitive’. On the negative side there are ‘negative’, ‘unusual’, ‘difficult’, and ‘bad’. One interesting inclusion that shows some of the limitations of sentiment analysis is ‘casualty’, where Mr. Buffett is not referring to death, but to the basket of property and casualty insurance companies that make up a significant portion of his business holdings. </p>
<p>While the above is interesting, and helps us to highlight the most frequent positive and negative words, it’s a bit limited in the number of words we can present before the graph becomes too crowded. To see a larger number of words, we can use a word cloud. The word cloud below shows 400 of the most commonly used words, split by positive and negative sentiment. </p>
<p><img title="plot of chunk wordcloud" alt="plot of chunk wordcloud" src="https://i0.wp.com/michaeltoth.me/figure/berkshire_hathaway_sentiment-wordcloud-1.png?w=456" data-recalc-dims="1"></p>
<p>If you’re interested in reproducing this blog post or analysis, please check out the <a target="_blank" rel="nofollow" href="https://github.com/michaeltoth/michaeltoth/blob/master/content/berkshire_hathaway_sentiment.Rmd">R code I used to produce this document</a></p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://michaeltoth.me/sentiment-analysis-of-warren-buffetts-letters-to-shareholders.html"> Michael Toth's Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/g-pQ4iye_qE"></a></div>