MIT Background Information

MIT Facebook Page Total Likes:904,977

Mission: The mission of MIT is to advance knowledge and educate students in science, technology, and other areas of scholarship that will best serve the nation and the world in the 21st century.

Story: MIT is independent, coeducational, and privately endowed. Its five schools and one college encompass numerous academic departments, divisions and degree-granting programs, as well as interdisciplinary centers, laboratories and programs whose work cuts across traditional departmental boundaries.

About: MIT is a world-class educational institution where teaching and research — with relevance to the practical world as a guiding principle — continue to be its primary purpose.

General Information: Degrees earned at MIT include bachelor’s, master’s and doctorates. In the 2009-2010 academic year, there were 4,232 undergraduate students and 6,152 graduate students

Awards: Faculty of MIT have won numerous awards, including the Nobel Prize, Medal of Science, John Bates Clark Medal, Fields Medal, PECASE awards, MacArthur ‘genius’ grants, and many more. Many faculty are members of the AAAS, IEEE, American Academy of Arts and Sciences, and other prestigious societies. Students from MIT are regularly named Fulbright Fellows, Marshall Scholars, Rhodes Scholars, Truman Scholars and Gates Scholars.

This is the code to download data from Facebook

library(Rfacebook)
## Loading required package: httr
## Loading required package: rjson
## Loading required package: httpuv
## 
## Attaching package: 'Rfacebook'
## The following object is masked from 'package:methods':
## 
##     getGroup
library(scales)  
library(ggplot2)
library(plyr)
library(sentimentr)
library(reshape2) 
library(syuzhet)
## 
## Attaching package: 'syuzhet'
## The following object is masked from 'package:sentimentr':
## 
##     get_sentences
## The following object is masked from 'package:scales':
## 
##     rescale
#setwd("/Users/robertslattery")
#load("my_oath")

#mit <- getPage(page = "mitnews",token = my_oath, n=25, reactions = T)
#write.csv(mit,"/Users/robertslattery/Facebook/mit.csv")
#Code to read a previously saved group of 25 Posts
mit <- read.csv(file.path("/Users/robertslattery/Facebook/mit.csv"), stringsAsFactors = FALSE)                      

This code was executed to pull the posts, comments and likes from each of the 25 Facebook Posts.

It was modified appropriately for each post

#mit.1 <- getPost(post=mit[1,1],n=500, token=my_oath)
#mit.posts.1 <- as.data.frame(mit.1$post)
#mit.comments.1 <- as.data.frame(mit.1$comments)
#mit.likes.1 <- as.data.frame(mit.1$likes)
#mit.likes.1$id <- mit.posts.1$id
#mit.comments.1$id <- mit.posts.1$id

These next lines combined the data from each post into data frames of Posts, Comments and Likes and then Saves them

#Combine the Comments and Likes into large data frames and save them and also save the posts
#mit.all.comments <- rbind(mit.comments.1, mit.comments.2, mit.comments.3, mit.comments.4, mit.comments.5, #mit.comments.6, mit.comments.7, mit.comments.8, mit.comments.9, mit.comments.10, mit.comments.11, mit.comments.12,
#mit.comments.13, mit.comments.14, mit.comments.15, mit.comments.16, mit.comments.17, mit.comments.18,
#mit.comments.19, mit.comments.20, mit.comments.21, mit.comments.22, mit.comments.23, #mit.comments.24,mit.comments.25)
#save(mit.all.comments, file = "/Users/robertslattery/Facebook/comments.RData")

#mit.all.likes <- rbind(mit.likes.1, mit.likes.2, mit.likes.3, mit.likes.4, mit.likes.5, mit.likes.6,
#                          mit.likes.7, mit.likes.8, mit.likes.9, mit.likes.10, mit.likes.11, mit.likes.12,
#                          mit.likes.13, mit.likes.14, mit.likes.15, mit.likes.16, mit.likes.17, mit.likes.18,
#                          mit.likes.19, mit.likes.20, mit.likes.21, mit.likes.22, mit.likes.23, mit.likes.24,
#                          mit.likes.25)
#save(mit.all.likes, file = "/Users/robertslattery/Facebook/likes.RData")
#save(mit, file = "/Users/robertslattery/Facebook/posts.RData") 

Here I will load the actual data files and run the analysis in Markdown.

load("/Users/robertslattery/Facebook/Slatteryposts.RData")
load("/Users/robertslattery/Facebook/Slatterycomments.RData")
load("/Users/robertslattery/Facebook/Slatterylikes.RData")

First I will clean the Comments of any strange symbols such as Emojis which can not be analyzed by the Syuzhet Package used here

mit.all.comments$message <- iconv(mit.all.comments$message, sub="", 'UTF-8', 'ASCII')

Now to actually do the analysis. This calculates the sentiment and emotions of each comment and then aggregates all the sentiments of each post.

#Do the Sentiment Analysis
mit.all.sentiment <- as.data.frame(get_nrc_sentiment(mit.all.comments$message))
mit.all.sentiment$id <- mit.all.comments$id
mit.all.sentiment.total <- aggregate(mit.all.sentiment[,1:10], list(mit.all.sentiment$id), sum)

Now here I map the Syuzhet emotions to equivalent or similar Facebook Reactions for comparison

#Map Syuzhet Sentiments to Facebook Reactions
mit.all.sentiment.total$Angry <- mit.all.sentiment.total$disgust + mit.all.sentiment.total$anger
mit.all.sentiment.total$Wow <- mit.all.sentiment.total$surprise + mit.all.sentiment.total$anticipation
mit.all.sentiment.total$Sad <- mit.all.sentiment.total$fear + mit.all.sentiment.total$sadness
mit.all.sentiment.total$Haha <- mit.all.sentiment.total$joy
mit.all.sentiment.total$Love <- mit.all.sentiment.total$trust

However it is important to note that these mappings are not precise and may not be entirely valid for comparison purposes but unless there is a package that can directly map word sentiment to Facebook reactions this is likely as good as it gets.

Now I sum the positive and subtract the negative Facebook Reactions to get a general Sentiment Rating, Positive or negative

#Find a total Sentiment by summing the positive and negative reactions
mit.sent <- as.data.frame(mit$love_count + mit$haha_count + mit$wow_count - mit$sad_count - mit$angry)
mit.sent$id <- mit$id
mit.sent$Sentiment <- mit.sent$`mit$love_count + mit$haha_count + mit$wow_count - mit$sad_count - mit$angry`
syuz.sent <- as.data.frame(mit.all.sentiment.total$Love + mit.all.sentiment.total$Haha + mit.all.sentiment.total$Wow - mit.all.sentiment.total$Angry - mit.all.sentiment.total$Sad)
syuz.sent$id <- mit.all.sentiment.total$Group.1
syuz.sent$Sentiment <- syuz.sent$`mit.all.sentiment.total$Love + mit.all.sentiment.total$Haha + mit.all.sentiment.total$Wow - mit.all.sentiment.total$Angry - mit.all.sentiment.total$Sad`

So now I calculate the Pearson Correlation and plot the Sentiments against eachother.

#Plotting the Sentiments and Calculating Pearson Correlation
syuz.sent <- syuz.sent[order(syuz.sent$id),]
mit.sent <- mit.sent[order(mit.sent$id),]
syuz.sent$`mit.all.sentiment.total$Love + mit.all.sentiment.total$Haha + mit.all.sentiment.total$Wow - mit.all.sentiment.total$Angry - mit.all.sentiment.total$Sad` <- NULL
mit.sent$`mit$love_count + mit$haha_count + mit$wow_count - mit$sad_count - mit$angry` <- NULL
cor(mit.sent[,2], syuz.sent[,2], method="pearson")
## [1] 0.5111269
plot(syuz.sent$Sentiment, mit.sent$Sentiment)

The results here show a Pearson Correlation of 0.511 which is a moderate Correlation and we can see from the plot that there is definitely correlation between the Comment Sentiments and the Facebook Reactions on any given post. However there are several outliers which are heavily skewing this correlation. Posts which are much more popular seem to be more polarized and there isn’t much agreement between the moods of the posters and those who just click a reaction and make no comments. There is probably some interesting Social Psychology at work here but that can’t be investigated with the available data.

Now plot the overall Sentiment and total Like Counts for each Post

ggplot(syuz.sent, aes(id, Sentiment)) + geom_point() 

ggplot(mit, aes(id, likes_count)) + geom_point()

From these two graphs we can see that there are a number of outlying posts which have much higher like counts but the analysis of the sentiment of all the posts shows that the sentiment is generally positive and with the range from 0 to 40. So the total popularity of the post doesn’t have much influence on the overall mood of the comments.

The most common Posters

#Most Frequent Posters
sort(table(mit.all.comments$from_name))
## 
##                 AA-Mohammed Mostafa                           Abbie Lee 
##                                   1                                   1 
##                          Abdul Hadi                         Abe Ledesma 
##                                   1                                   1 
##                      Abhijeet Kumar                         Ahmed Sayed 
##                                   1                                   1 
##                     Aimée Gillespie                         Ajay Sharma 
##                                   1                                   1 
##                      Akshay K Rahul                      Alex Rodríguez 
##                                   1                                   1 
##                Alfredo de la Fuente                           Ali Mclay 
##                                   1                                   1 
##                    Allan John Sluis                     Amir Ebrahimnia 
##                                   1                                   1 
##                       Anjana Sharma                       Arlene Rivera 
##                                   1                                   1 
##                      Aroon Boonsiri                      Arshad Hussain 
##                                   1                                   1 
##                         Ashu Savani                         Asit Parikh 
##                                   1                                   1 
##                     Asmatullah Khan                        Assamin Nour 
##                                   1                                   1 
##              Astrid Rodríguez Vélez                   Attique UR Rehman 
##                                   1                                   1 
##                         Aviral Jain                    Barbara Holliday 
##                                   1                                   1 
##                      Barbara Thomas                      Benoit Rheault 
##                                   1                                   1 
##                  Bernhard Kratzwald               Blas Navarrete Araujo 
##                                   1                                   1 
## Book: A Patriot's A to Z of America                      Brad Philipbar 
##                                   1                                   1 
##                       Brenda Monson                     Brian Passineau 
##                                   1                                   1 
##                      Caridad Garcia              Carol Lukacs Hallowell 
##                                   1                                   1 
##                    Charlie McDonald                      Charlie Parker 
##                                   1                                   1 
##                     Chejinis Rivera                     Christhian Lima 
##                                   1                                   1 
##                    Christopher Linn                         Cindy Zhang 
##                                   1                                   1 
##                      Clarise Snyder                            CR Sergh 
##                                   1                                   1 
##                        Daniel Byers                       Daniel Ovalle 
##                                   1                                   1 
##                         Daniel Peña                        Danish Yasin 
##                                   1                                   1 
##                     Darius Baltazar                        Daulat Elias 
##                                   1                                   1 
##                       David Cardill                         David Jones 
##                                   1                                   1 
##                       David Tassoni                        Davon Hunter 
##                                   1                                   1 
##                          Dean Johdy                         Debby Edgar 
##                                   1                                   1 
##                      Denise Segovia                         Derek Smart 
##                                   1                                   1 
##             Diana Fernández Sánchez                         Diana Towle 
##                                   1                                   1 
##                          Diego Ríos                            Dior Dna 
##                                   1                                   1 
##                       Donald Earner                     Elder Escribano 
##                                   1                                   1 
##                       Elena Colombo                    Eleni Kanatsouli 
##                                   1                                   1 
##                      Eleonora Fusco                       Elisavet Mist 
##                                   1                                   1 
##                Elizabeth Anne Brock                      Emmanuel López 
##                                   1                                   1 
##                   Estrella Espinoza                     Fernando Mujica 
##                                   1                                   1 
##                     Fernando Yordan                       Flavio Chuahy 
##                                   1                                   1 
##                         Floyd Waite             Francisco Matias Schaer 
##                                   1                                   1 
##         Francisco Proskauer Valerio                        Frank Barcus 
##                                   1                                   1 
##                   Frank Fanyi Zhang                   Frank H. Nein Jr. 
##                                   1                                   1 
##                          Fredy Saie                        Gabby Valdes 
##                                   1                                   1 
##              Génesis García Santini                    Gerd Moe-Behrens 
##                                   1                                   1 
##        Giorgia Rosa Fernanda Zunino                           Glyn Louk 
##                                   1                                   1 
##                       Grace C Young                        Grecia Pisté 
##                                   1                                   1 
##                           Gry Folge                         Gura Grillo 
##                                   1                                   1 
##                           Haemi Lee               Hafizuddin Aero Astro 
##                                   1                                   1 
##                 Handy heater amazon                     Harsh Bhatnagar 
##                                   1                                   1 
##                         Henry Wulff                      Ignacio Zúñiga 
##                                   1                                   1 
##                         IRfan Ahmed                        Iris Schilke 
##                                   1                                   1 
##                       Irshad Shaikh                     Ismail Odetokun 
##                                   1                                   1 
##                        Jagmeet Kaur                  Jason L. Berlowitz 
##                                   1                                   1 
##                       Jason Lessard                       Jason Trichel 
##                                   1                                   1 
##                       Javir Twell A                       JB Franceschi 
##                                   1                                   1 
##                     Jeffrey Schantz                         Jefri Tamba 
##                                   1                                   1 
##                           Jen Neely                     Jeremy Jay Liao 
##                                   1                                   1 
##                    Jessica Noviello                   Jessie-Emma Smith 
##                                   1                                   1 
##               Jesus González Pastor                    JJ Prieto Rivera 
##                                   1                                   1 
##                    João Lúcio Gomes                        Joe Campbell 
##                                   1                                   1 
##                           John Bond                        John J Chiki 
##                                   1                                   1 
##                            John Lee                     Jonathas Kerber 
##                                   1                                   1 
##                  Joni Predi Siregar                     Jordan Albertus 
##                                   1                                   1 
##                  Jordan Sean Hughes                 Jorge Andrés Medina 
##                                   1                                   1 
##                         Jorge Silén       Jose Manuel Sanchez Soldevila 
##                                   1                                   1 
##                       Joseph George                         Jude Morgan 
##                                   1                                   1 
##                           Julio Daz                          Kabir Khan 
##                                   1                                   1 
##                      Kaiwal Panchal                            Karam Da 
##                                   1                                   1 
##                             Kaya Ni                           Kenny Man 
##                                   1                                   1 
##                      Khalid Mohamed                        Khanh Nguyen 
##                                   1                                   1 
##                Laura Sadhana Fricke                            Leo Pose 
##                                   1                                   1 
##                       Liliana Ortiz                         Liu Tsz Fun 
##                                   1                                   1 
##                         Liu Yinsong                       Loïc Crobeddu 
##                                   1                                   1 
##                          Lon DeGraw                           Lori Rose 
##                                   1                                   1 
##                      Louise Martins                Luck Benny Toussaint 
##                                   1                                   1 
##                       Lucy Molinari                     Ludmi Ratnayake 
##                                   1                                   1 
##                           Lynn Otto                     M M Shams India 
##                                   1                                   1 
##                       Maddie Garcia                      Maia Weinstock 
##                                   1                                   1 
##                        Maíra Yasmin                         Manoj Kumar 
##                                   1                                   1 
##                     Manolo Gonzalez                       Manuel Rivera 
##                                   1                                   1 
##         María Carolina Poveda Amaya             Marianela Méndez García 
##                                   1                                   1 
##                      Maribel Guzmán              Marilyn Andino Santana 
##                                   1                                   1 
##                          MariYan VG                          Mark Rekuc 
##                                   1                                   1 
##                         Martha Chow                Matteo Uccio Arlotti 
##                                   1                                   1 
##                    Matthew Bradford                   Matthew McInerney 
##                                   1                                   1 
##                     Mauricio Torres                        Mayank Kumar 
##                                   1                                   1 
##                 Mayank Vishwabandhu                   MD Shahidul Islam 
##                                   1                                   1 
##                      Md Shamsuzzoha              Mehmed Truman Kukavica 
##                                   1                                   1 
##                          Mehran Ali                    Meral Ekincioglu 
##                                   1                                   1 
##                  Michael Feuerstein                     Michael Kapteyn 
##                                   1                                   1 
##                    Michael Williams                         Min Jae Kim 
##                                   1                                   1 
##                        Mitko Mitkov                     Mohammad Nassar 
##                                   1                                   1 
##                       Muhammad Umer                       Myo Hein Thet 
##                                   1                                   1 
##               Nacquia Smith Johnson                        Nameera Azim 
##                                   1                                   1 
##                 Natalia Siena Brody                      Neftali Rosado 
##                                   1                                   1 
##                     Neicy Browneyez                        Newton Meter 
##                                   1                                   1 
##              Newton Pinedo Quintana                       Nikitas Gagas 
##                                   1                                   1 
##                         Nishit Jain                         Nitin Goley 
##                                   1                                   1 
##                      Norma R. Yount                     Olumide Johnson 
##                                   1                                   1 
##                     Oruche Goodluck                       Ovais Crimson 
##                                   1                                   1 
##                     Pablo Aqueveque                      Patrick Dobson 
##                                   1                                   1 
##                       Patrick Neuls                  Patrick T DiCaprio 
##                                   1                                   1 
##                      Patsy Fordjour                           Pedd Raam 
##                                   1                                   1 
##                            Pedro LV                            Pha Thai 
##                                   1                                   1 
##                      Pranav Agrawal                    Pratham Bhargava 
##                                   1                                   1 
##                          Rafaela PS                         Ram Gopalan 
##                                   1                                   1 
##               Rashonda Stubblefield                          Raúl Tello 
##                                   1                                   1 
##                        Rhiana Rivas                     Rishabh Awasthi 
##                                   1                                   1 
##                          Rita Silva                        Robert Jason 
##                                   1                                   1 
##                        Robert Olson                      Roberto Bellas 
##                                   1                                   1 
##                     Robin Rogerfeld                         Rodrigo Ruz 
##                                   1                                   1 
##                         Rohit Korde                    Ronaldo Talagtag 
##                                   1                                   1 
##                       Ruth Telschow                          Ryan Faber 
##                                   1                                   1 
##                      Sabrina Madera             Sabyasachi Mukhopadhyay 
##                                   1                                   1 
##                  Sahabuddin Hossain                      Sambhuti Anand 
##                                   1                                   1 
##                       Sanjay Biswas           Santos Alejandro Camarena 
##                                   1                                   1 
##                     Sayam Kumar Das                 Sebasthian Santiago 
##                                   1                                   1 
##                           Seif Alaa                         Shaba Shams 
##                                   1                                   1 
##                        Shannon Peng                           Sharegist 
##                                   1                                   1 
##                        Shawn Keally                      Shawn Mcdowell 
##                                   1                                   1 
##                     Shubham Bhushan          Silvia Patricia Rivas Poma 
##                                   1                                   1 
##                      Simone Pifferi                   Sinushine Kathare 
##                                   1                                   1 
##                      Soumyadeep Roy                        Srimanta Roy 
##                                   1                                   1 
##                        Stael Naseri                   Stelios Angelidis 
##                                   1                                   1 
##                        Stephanie Li                        Stuart Boben 
##                                   1                                   1 
##                      Surender Gupta                       Suzanne Cable 
##                                   1                                   1 
##                       Sylvain Proux                    Tarridode Marmol 
##                                   1                                   1 
##                       Teresa Nguyen                     Terre Hernandez 
##                                   1                                   1 
##                     Thatiana Soares              Thomas Percipient Olum 
##                                   1                                   1 
##                 Thuto Douglas Maebe                       Tobias Mathew 
##                                   1                                   1 
##                        Tom Humphrey                         Toño Lozano 
##                                   1                                   1 
##                  Turkey Visit Guide                          Uwe Bürgin 
##                                   1                                   1 
##                  Vachagan Gevorgyan                     Vaggelis Goumas 
##                                   1                                   1 
##                     Vanessa Persaud                        Vatsal Dhaka 
##                                   1                                   1 
##                  Venkatesh Les Paul                    Vineet K Kashyap 
##                                   1                                   1 
##                Vinita Seth Rampuria                     Vivek Chaurasia 
##                                   1                                   1 
##                    Wayne A. Seltzer                       William Allen 
##                                   1                                   1 
##                 William Casey Wells                        Yacoub Jomaa 
##                                   1                                   1 
##               Yardley Yanira Rosado                     Yiovani Burbano 
##                                   1                                   1 
##                       Zaza Asatiani                      Zeeshan Haider 
##                                   1                                   1 
##           Zokou Pasteur Amedée Zadi                        Ztevan Whyte 
##                                   1                                   1 
##                        Фёдор Иванов                       अदिती भारद्वाज़ 
##                                   1                                   1 
##                          Aaron Puah                  Abdellah EL Goutbi 
##                                   2                                   2 
##              Adroit Toriq Nur Fajar                    Andrea Messidoro 
##                                   2                                   2 
##                       Dan Bierwirth                  Dibakar Kachari DK 
##                                   2                                   2 
##                             Indi Go                       Jim O'Donnell 
##                                   2                                   2 
##                   Johnathan Roberts                          Johnny Cox 
##                                   2                                   2 
##                       Juan de Souza            Julian R. Rodriguez-Bird 
##                                   2                                   2 
##               Marie D'Ambrosio King                      Mark E. Wilcox 
##                                   2                                   2 
##                 Milind Ayush Tiwari                        Paul L. Rand 
##                                   2                                   2 
##                        Paula Zelaya                         Pinkee Devi 
##                                   2                                   2 
##                  Prabhakar Marshall                      Ramandeep Gill 
##                                   2                                   2 
##                     Randy Ramtahell                       Range Gowda A 
##                                   2                                   2 
##                      Rodrigue Mentz                      Samia Siddique 
##                                   2                                   2 
##                Sara Gomez Arancibia                     Sunday Wingling 
##                                   2                                   2 
##                        Yong Li Dich                      Keon Jae Jeong 
##                                   2                                   3 
##                         Adri Ferent                       Jack B Srimof 
##                                   4                                   4 
##                        Marcy Fabian                          Neha Arora 
##                                   4                                   4 
##                   Sidharth Sidharth                              신진실 
##                                   4                                   8 
##                      Peter Ossimini                    Sonu Kumar Yadav 
##                                  12                                  12
sort(table(mit.all.comments$from_id))
## 
##  1005335636262343  1009874822450335 10100470135102967 10101040731697138 
##                 1                 1                 1                 1 
## 10101040731702128 10101040751966518 10153920495281962 10153924618766073 
##                 1                 1                 1                 1 
## 10153972552556625 10154016028215978 10154028489056932 10154087582706762 
##                 1                 1                 1                 1 
## 10154095175207467 10154108564817023 10154128959878946 10154135631937217 
##                 1                 1                 1                 1 
## 10154174347342712 10154177951356089 10154184173862921 10154235332296848 
##                 1                 1                 1                 1 
## 10154249120209895 10154285792925186 10154352660049024 10154357882264864 
##                 1                 1                 1                 1 
## 10154366290215910 10154369117049335 10154465173424279 10154478355140129 
##                 1                 1                 1                 1 
## 10154535943500630 10154552991545664 10154647055451031 10154654096581702 
##                 1                 1                 1                 1 
## 10154657829563116 10154676953218632 10154680029834477 10154698834368186 
##                 1                 1                 1                 1 
## 10154717017934785 10154725675648794 10154734798788996 10154743180124910 
##                 1                 1                 1                 1 
## 10154773203642840 10154780155704549 10154833251740739 10155568217109899 
##                 1                 1                 1                 1 
## 10157803671890182 10157810110185284 10157849230800707 10158110089910508 
##                 1                 1                 1                 1 
##  1019127974879461 10202486727804772 10202547958535891 10202706117171727 
##                 1                 1                 1                 1 
## 10202767526865126 10202801393473675 10205793771402874 10205823810193545 
##                 1                 1                 1                 1 
## 10205901679979520 10205925141646607 10206460212898877 10207148719945830 
##                 1                 1                 1                 1 
## 10207396502691075 10207398575914725 10207692240290546 10207708890583532 
##                 1                 1                 1                 1 
## 10207936801474099 10207977884310089 10208088101748768 10208143049153809 
##                 1                 1                 1                 1 
## 10208212916666878 10208610294958695 10209034593413549 10209095669563622 
##                 1                 1                 1                 1 
## 10209194503918466 10209212714728011 10209319896447247 10209362566834216 
##                 1                 1                 1                 1 
## 10209575457997283 10209600598286273 10209628906093976 10209755735103040 
##                 1                 1                 1                 1 
## 10209756403738812 10209766556857161 10209806231425556 10209865900958274 
##                 1                 1                 1                 1 
## 10209952957153288 10209961155019928 10209986427311009 10210139840886608 
##                 1                 1                 1                 1 
## 10210587123304670 10210706902564706 10210889094608865 10210889502216475 
##                 1                 1                 1                 1 
## 10210955445026723 10210961922515245 10211018734365617 10211132843061308 
##                 1                 1                 1                 1 
## 10211155179695599 10211163819393660 10211177961025402 10211232093624059 
##                 1                 1                 1                 1 
## 10211245279638169 10211417900102597 10211444572540158 10211503556569274 
##                 1                 1                 1                 1 
## 10211535189921644 10211550084254620 10211572102803244 10211607550530033 
##                 1                 1                 1                 1 
## 10211670157895448 10211818286358289 10211878119168151  1024865174306185 
##                 1                 1                 1                 1 
##  1025669610876529  1035145383277815  1060442287400470  1108917305891940 
##                 1                 1                 1                 1 
##  1114473781993678  1118796894905982  1124642284317804  1130549213726430 
##                 1                 1                 1                 1 
##  1136102666485032  1143570552378031  1150665301635406  1150682355000631 
##                 1                 1                 1                 1 
##  1151958251548320  1154433601271556  1155783354535558  1156578711128153 
##                 1                 1                 1                 1 
##  1162600440491860  1163317450421501  1164052486976613  1168898813146966 
##                 1                 1                 1                 1 
##  1174637825957036  1178418048914674  1181855568573762  1185495348208530 
##                 1                 1                 1                 1 
##  1190747487659719  1196261330463257  1198527176850806  1217483488317538 
##                 1                 1                 1                 1 
##  1218961521530917  1219428791471589  1220560331315836  1231883463521717 
##                 1                 1                 1                 1 
##  1234318079940519  1236705879708761  1239902309399804  1243602995686521 
##                 1                 1                 1                 1 
##  1244457378926261  1248996735123721  1251109678282161  1253236658030029 
##                 1                 1                 1                 1 
##   126361417847573  1266144466791996   126719187811491  1274175072640050 
##                 1                 1                 1                 1 
##  1275863075768265  1280045872036484  1281916821861222  1282756665131568 
##                 1                 1                 1                 1 
##  1287336384650831  1290446041007298  1297567140293528  1297917143573765 
##                 1                 1                 1                 1 
##  1301491443215681  1306026776083072  1309154922469200  1324145387598604 
##                 1                 1                 1                 1 
##  1324273620940497  1337509462933947  1340103302707875  1343373759027714 
##                 1                 1                 1                 1 
##  1346286885416253  1350542344979044  1357529657598626  1358228737523453 
##                 1                 1                 1                 1 
##  1370359009671419   137440866738408  1378411782204133  1382005635144353 
##                 1                 1                 1                 1 
##  1386533524713732  1398358740182083  1429569080405510  1447237315300114 
##                 1                 1                 1                 1 
##  1461993480495507  1470383576322559  1473416886069232  1517667934916951 
##                 1                 1                 1                 1 
##  1521505754532483  1530368370517757  1535951083088225  1553798424634013 
##                 1                 1                 1                 1 
##  1605163079793039  1609196712716171   161045964368636  1610722615898006 
##                 1                 1                 1                 1 
##  1634303626869992  1677776155866869  1681013502228063  1691569051155672 
##                 1                 1                 1                 1 
##  1717387481911389  1734129003580037  1758192827775334   177352519395363 
##                 1                 1                 1                 1 
##  1785591898360625  1790714971153381  1807858449435168  1808749909407841 
##                 1                 1                 1                 1 
##  1810271735917136  1813033518936811  1818736085073658  1830959240483290 
##                 1                 1                 1                 1 
##  1832290746990049  1833397443540442  1846217645613609  1851687081784709 
##                 1                 1                 1                 1 
##  1855908234696422  1862320664054546  1884412548447458  2030259217200483 
##                 1                 1                 1                 1 
##   206766696446238  2090187334339684   209450126167467  2164289330462233 
##                 1                 1                 1                 1 
##  2165521507007330   217323085373489  2178245632400478   219071688536235 
##                 1                 1                 1                 1 
##  2201224720102709   224212801333562   224460234652481   237468896673428 
##                 1                 1                 1                 1 
##   245648415473995   282347362166683   294785087582982   332757750089121 
##                 1                 1                 1                 1 
##   333689340338316   335364996832472   338614076508056   339451113089341 
##                 1                 1                 1                 1 
##   346764375693054   348871608814156   349741735390716   351580048526201 
##                 1                 1                 1                 1 
##   351810308509309   359344801083361   366224583726502   370400063302536 
##                 1                 1                 1                 1 
##   378192882523040   391850634480331   548015678741067   572450926298749 
##                 1                 1                 1                 1 
##   577174752468079   582727348588581   591182031065200   593907067459797 
##                 1                 1                 1                 1 
##   601606573374036   629533903891376   651714261701330   658798090961810 
##                 1                 1                 1                 1 
##   666494306854036   676108895904333   693098840846841   695784570587451 
##                 1                 1                 1                 1 
##   706118832887728   706621429488093   714961098534565   720102724820184 
##                 1                 1                 1                 1 
##   723804454440159      732890474486   756934541121644   758771454262392 
##                 1                 1                 1                 1 
##   791845187622831   885020874932245   900976603365930   918059224990847 
##                 1                 1                 1                 1 
##   924784767656323   933903250076352   941005456044081   965782590232882 
##                 1                 1                 1                 1 
## 10153775283196706 10154039988416186 10156235380903644 10207873511579965 
##                 2                 2                 2                 2 
## 10210238917146463 10211047144672162 10211079684578726 10211302633506687 
##                 2                 2                 2                 2 
## 10211628985986662  1083220691790674  1085548221564825  1147986465308880 
##                 2                 2                 2                 2 
##   118762135276589  1243601109019989  1292616897476929  1335096529834596 
##                 2                 2                 2                 2 
##  1344500692249445  1359565654056418  1492236807466949  1625686177727586 
##                 2                 2                 2                 2 
##  1665419620416826  1796832877232506  1811554795759290   312626092464170 
##                 2                 2                 2                 2 
##   340732296293093   538872049644425   544533385737231  1263013277103876 
##                 2                 2                 2                 3 
## 10208462824674279   137193320096344  1603945726576809  1763572040570768 
##                 4                 4                 4                 4 
##   199379500518737   114175139070126  1717784775205289   953351858103164 
##                 4                 8                12                12
names(which(table(mit.all.comments$from_name) == max(table(mit.all.comments$from_name))))
## [1] "Peter Ossimini"   "Sonu Kumar Yadav"
max(table(mit.all.comments$from_name))
## [1] 12

This code shows that the Most prolific posters are Sonu Kumar Yadav and Peter Ossimini with 12 comments each.

This next block of code combines the comments of the top 10 commenters into a large Data Frame

common.posters <- as.data.frame(mit.all.comments[mit.all.comments == "114175139070126" | mit.all.comments == "953351858103164" | 
                                                 mit.all.comments == "1603945726576809" | mit.all.comments == "1717784775205289" |
                                                 mit.all.comments == "137193320096344" | mit.all.comments == "10208462824674279" |
                                                 mit.all.comments == "1263013277103876" | mit.all.comments == "544533385737231" |
                                                 mit.all.comments == "1763572040570768" | mit.all.comments == "199379500518737",])

Printing 30 of the comments yields some insight.

print(common.posters[1:30,2:3])
##             from_name
## 5   Sidharth Sidharth
## 8   Sidharth Sidharth
## 16  Sidharth Sidharth
## 19  Sidharth Sidharth
## 29   Sonu Kumar Yadav
## 45   Sonu Kumar Yadav
## 48     Peter Ossimini
## 68   Sonu Kumar Yadav
## 79     Peter Ossimini
## 84   Sonu Kumar Yadav
## 103      Marcy Fabian
## 146     Jack B Srimof
## 147  Sonu Kumar Yadav
## 148    Peter Ossimini
## 149    Peter Ossimini
## 155            신진실
## 156            신진실
## 160    Peter Ossimini
## 166  Sonu Kumar Yadav
## 167    Keon Jae Jeong
## 170    Peter Ossimini
## 171        Neha Arora
## 172        Neha Arora
## 186      Marcy Fabian
## 191  Sonu Kumar Yadav
## 192    Keon Jae Jeong
## 194            신진실
## 195     Jack B Srimof
## 218    Peter Ossimini
## 221  Sonu Kumar Yadav
##                                                                                                                            message
## 5     My first interview with Keith about Nobel prizes\nhttps://m.facebook.com/story.php?story_fbid=10154154560767309&id=651752308
## 8     My first interview with Keith about Nobel prizes\nhttps://m.facebook.com/story.php?story_fbid=10154154560767309&id=651752308
## 16    My first interview with Keith about Nobel prizes\nhttps://m.facebook.com/story.php?story_fbid=10154154560767309&id=651752308
## 19    My first interview with Keith about Nobel prizes\nhttps://m.facebook.com/story.php?story_fbid=10154154560767309&id=651752308
## 29                                                                                                                    That's great
## 45                                                                                                                            Nice
## 48  How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 68                                                                                                                       Very nice
## 79  How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 84                                                                          Amazing picture of moon a great day of world history..
## 103                                                                                                                    Beautiful!!
## 146                                                                                                               above , a joke .
## 147                                                                                                                           Nice
## 148 How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 149 How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 155                                                                                                                               
## 156                                                                                                                              ?
## 160 How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 166                                                                                                                               
## 167                                                                                                                     thank you!
## 170 How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 171                                         http://kalmanserve.com/lan1.aspx?r=regular\thttp://kalmanserve.com/images/set1/125.gif
## 172                                         http://kalmanserve.com/lan1.aspx?r=regular\thttp://kalmanserve.com/images/set1/125.gif
## 186                                                                                                              Congratulations!!
## 191                                                                                                                         Lovely
## 192                                                                                                                     thank you!
## 194                                                                                                                              ?
## 195                                                                                                Puerto Rico is not part of US .
## 218 How many christian organizations exist in the middle east in order to you allow this? https://www.facebook.com/mitmsa/?fref=ts
## 221                                                                                                                         Lovely

It appears that many of the comments of the top posters are spam type messages, advertising a website or containing political/religous or other irrelvant rantings.

Let’s get the Sentiment and number of posts for each of the top commenters

#Sentiment of common posters
common.posters.sentiment <- as.data.frame(get_nrc_sentiment(common.posters$message))
common.posters.sentiment$from_name <- common.posters$from_name
common.posters.total <- aggregate(common.posters.sentiment[,1:10], list(common.posters.sentiment$from_name), sum)
common.posters.total2 <- colSums(common.posters.sentiment[,1:10])
num.comments <- as.data.frame(sort(table(common.posters$from_name)))

Plotting the top commenter sentiment and number of posts

#Plot habits and sentiment of top 10 posters
ggplot(num.comments, aes(Var1, Freq)) + geom_point() + labs(x="Name of Poster", y="Frequency of Posts") + ylim(0, 15)

barplot(common.posters.total2)

So we can see that the top commenters post much more than the other commenters and that generally the sentiment of these comments are quite positive.

Brand Recommendations

MIT has one of the most influential brands in the World and its scope goes well beyond that of a normal University. The results of this analysis shows that it enjoys relatively stable popularity as shown by the plots of Likes and occasionally has “Viral” posts which are many times more popular than it’s usual posts. The analysis also shows that there are occasional posts which have very negative reactions as shown by the Syuzhet sentiment and Facebook Reactions. It is likely that these posts are cover topics that are highly politicized and evoke strong reactions from individuals on Facebook. Investigations of the top commenters show that there is a problem with spam posts. Both the top posters post the same comment many times and seem to be advertising something or contain Political ramblings. Though in general the other top commenters are strongly positive in their comments. MIT as a brand is simply impeccable and I have no recommendations in that regard. However its Facebook page could be more carefully curated to ensure that its atmosphere is one of Scholarship and highlights its Research. They should be careful to avoid posting topics that are too political if they wish to avoid backlash, though many topics such as Climate Change which are highly politicized are important areas of research at a school like MIT, and investigate the nature of the posts which are much more popular than others in order to get a sense of what are the most popular topics. They should also curate the comment sections since there generally appears to be a problem with people posting irrelevant spam in many different posts. This degrades from the quality of the discussions in the comments and should be monitored. MIT’s name is as strong as it has ever been and aside from tweaking their Social Media presences there is little that can be done to improve its standing.