library(ggplot2)
library(gridExtra)

The data represents three years of social media metrics for Starbucks (courtesy of Dr. David Schweidel, Emory University). The number of positive, neutral, and negative posts was used to derive a composite sentiment for each day (SentimentComposite) as well as a sentiment ratio (SentimentRatio). In feature Volume represents the total number of Twitter posts for each day while NumberOfAuthors and PostsPerAuthor represent the number of authors contributing posts and the average number of posts per author, respectively. All values were normalized using the mean values for the month of February as a baseline.

#Read the data file and convert date from factor to actual date format
df = read.csv("SocialMediaMonitoringWeek4.csv", header=TRUE)
df$Date <- as.Date(df$Date, format="%m/%d/%Y")

The graph below shows the change in the normalized volume of tweets as a function of time. The actual dates corresponding to a certain level can be easily queried using df$Date[df$Volume > 5], for example. The dates returned by this particular query are shown below the graph. The dates selected for furher analysis are February 10, 2014, February 14, 2015, and Novemebr 9, 2015.

#Plot of change in volume as a function of time
ggplot(df, aes(x=Date, y=Volume, group=1)) + geom_point() + geom_line()

df$Date[df$Volume > 5]
##  [1] "2014-02-10" "2014-06-12" "2014-06-16" "2014-10-30" "2015-02-14"
##  [6] "2015-03-17" "2015-06-25" "2015-11-02" "2015-11-09" "2015-11-10"
## [11] "2016-02-22" "2016-08-09" "2016-11-01" "2016-11-02" "2016-11-10"
## [16] "2016-11-18"

The next graph shows changes in the normalized composite sentiment of tweets as a function of time. The composite is the percent difference between positive and negative tweets with larger, positive percentages representing a preponderance of positive tweets while negative values represent a greater proportion of negative tweets. The normalized composite sentiment values for February 10, 2014, February 14, 2015, and November 9, 2015 were approximately -7, 20, and -5, respectively suggesting that tweet sentiments were largely positive for an event taking place on, or just before, February 14, 2015 and negative for the two other dates.

#Plot of change in tweet composite sentiment as a function of time
ggplot(df, aes(x=Date, y=Sentiment_Composite, group=1)) + geom_point() + geom_line()

The next graph shows changes in the sentiment ratio of tweets as a function of time. A ratio greater than one indicates a greater number of positive tweets as compared to negative tweets while a ratio smaller than one indicates the reverse. Similar to the findings for the composite sentiment, the event on or just before February 14, 2015 was perceived in a positive light while the other two events at February 10, 2014 and November 9, 2015 were likely negative.

#Plot of change in tweet sentiment ratio as a function of time
ggplot(df, aes(x=Date, y=Sentiment_Ratio, group=1)) + geom_point() + geom_line()

The final graph shown below combines the number of authors and the number of posts per author. The number of authors was approximately -1 on February 10, 2014, 7 on February 14, 2015, and 3 on November 9, 2015 indicating fewer authors for the first event as compared to the baseline established with data from January 2014 whereas the other two dates showed a large increase in the number of authors. In contrast, the number of posts per author was negative for all three dates, namely, -0.6 for February 10, 2014, -4.2 for February 14, 2015, and -2.4 for November 9, 2015.

#Plot of change in number of authors and posts per author as a function of time
p1 <- ggplot(df, aes(x=Date, y=NumberOfAuthors, group=1)) + geom_point() + geom_line()
p2 <- ggplot(df, aes(x=Date, y=PostsPerAuthor, group=1)) + geom_point() + geom_line()
grid.arrange(p1, p2, ncol=1)

February 10, 2014

The most noteworthy event taking place on February 10, 2014 (in relation to the Starbucks name) was the opening of “Dumb Starbucks” in a small strip mall in Los Angeles, CA which distributed free coffee all day long (http://money.cnn.com/2014/02/10/news/companies/dumb-starbucks/). Although it is not unreasonable to assume that loyal customers of Starbucks would comment on this negatively, hence the negative scores for tweet composite sentiment and tweet sentiment ratio. It is of note that the number of authors was sightly less as compared to the January 2014 baseline suggesting that negative sentiments were largely due to a number of ‘influential’ authors followed by retweets of the original post.

February 14, 2015

The increased number of, mostly, positive, posts mat be related tothe debut of a new range of bottled iced teas in partnership with Anheuser-Busch (http://www.foodbev.com/news/starbucks-rolls-out-bottled-iced-teas-in-partnership-with-ab-inbev/). The number of authors was greater as compared to the January 2014 baseline while the number of posts per author seemed to be less. This suggests that the positive posts were being generated by a significantly higher number of authors as compared to more posts per author.

November 9, 2015

Starbucks introduced new holiday cup designs on November 9, 2015 (http://digiday.com/marketing/starbucks-red-cups-evangelist/) which apparently generated an increased volume of negative posts by a higher number of authors, as compared to the January 2014 baeline. It should be realized that without actually sampling a subset of the posts’ texts, it is not possible to attribute the negative sentiment to the actual introduction of the cups or to a reaction by authors denouncing those that did not agree with the new designs.