Warren Buffett Shareholder Letters: Sentiment Analysis in R

April 18, 2017
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

Warren Buffett — known as the "Oracle of Omaha" — is one of the most successful investors of all time. Wherever the winds of the market may blow, he always seems to find a way to deliver impressive returns for his investors and his company, Berkshire Hathaway. Every year he authors his famous "shareholder letter" with his musing about the market and investment strategy and — perhaps as reflects his continued success — this sentiment analysis of his letters by data scientist Michael Toth shows that the tone has been generally positive over time. Only five of the forty years of letters show an average negative sentiment: those correspond to market downturns in 1987, 1990, 2001/2002 and 2008.

Berkshire_hathaway_sentiment

Michael used the R language to generate a sentiment score for each letter, and the process was surprisingly simple (you can find the R code here). The letters are published as PDF documents, from which the text can be extracted using the pdf_text function in the pdftools package. Then you can use the tidytext package to decompose the letters into individual words, whose Bing sentiment score can be calculated using its get_sentiments function. From there, a simple ggplot2 bar chart is used to show the average sentiment scores for each letter.

For more on the sentiment of Warren Buffett's shareholder letters, including an analysis of the most-used positive and negative words, follow the link to the complete blog post below.

Michael Toth: Sentiment Analysis of Warren Buffett's Letters to Shareholders

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)