Does social media sentiment make a difference in Kroger’s stock price? Specifically, is the closing stock price influenced by the sentiment contained in tweets that mention Kroger? As an employee and stockholder of Kroger I am always interested in what drives both the stock and the chatter on social media. In order to try and answer this question 2 databases were used. The unstructured database is 61,206 indiviual tweets with 93 descriptive variables that were gathered using rtweet for scraping. The dates collected were from 11/8 - 11/15. In the collection of tweets the keywords used to search were Kroger and @Kroger, retweets were not collected. The structured database was collected from Yahoo Finance and includes Kroger as well as 4 of their closest competitors, according to Yahoo Finance. The competitors included are CVS, Costco, Target, and Walmart. The competitors were not used in this particular analysis but would be an interesting future analysis. The financial database includes 9 descriptive variables including opening and closing stock price. A data dictionary and datatable for each database is included below. The tweeter datatable in the documet below has a reduced number of variables due to the size of the database. Included are in the table are created_at, screen_name, text and date. The full database is available in the download section of the document along with the full stock database.
The packages required for this markdown are:
| Package | Summary |
|---|---|
| tidyverse | The tidyverse collection of packages |
| lubridate | Tools for manipulating dates |
| tidytext | Functionality to tokenize by commonly used units of text |
| DT | Datatables |
| knitr | Kable tables |
| PerformanceAnalytics | Tools for statistical analysis |
| stargazer | Tools for well formatted regression tables |
download the .csv files to your working directory THEN import it using the following url: https://myxavier-my.sharepoint.com/:x:/g/personal/burkartc_xavier_edu/EQh-wjOQkEBEmIoq5WSdKWMBhjHeGOvwszw4OzppA9bD2g?Download=1 https://myxavier-my.sharepoint.com/:x:/g/personal/burkartc_xavier_edu/EXiBVAkr1XRGqpRHe8LBoEYBk8wJkfUwMZA5e2Kvw8eU-A?Downoad=1
| Variable Name | Description |
|---|---|
| created_at | Time and date the tweet was created |
| screen_name | Twitter screen name of tweet creator |
| text | The text that the tweet contained |
| query | Twitter search used to find tweets |
| date | lubridate in year-month-day-hour-minute-second format |
| tweet_id | Unique id per tweet to enable unnesting of text |