1. Analyzing Social Impact of Campus Shooting Using Twitter Data
Tong Wu, Qunhua Li
Dept. of Statistics, Penn State University, University Park, PA, USA
Summary
[1] Ingo Feinerer, Kurt Hornik, and David Meyer (2008). Text Mining Infrastructure in R. Journal of Statistical Software 25(5): 1-54. URL:
http://www.jstatsoft.org/v25/i05/
[2] Ian Fellows (2014). wordcloud: Word Clouds. R package version
2.5. http://CRAN.R-project.org/package=wordcloud
Acknowledgment:. This research is sponsored by ECOS Undergraduate Research Award
References:
Data Analysis
Data AnalysisIntroduction
In this study, we used Twitter data (tweets) collected in West Lafyette, IN from Jan 1, 2014
to June 30, 2014. Particularly, we extracted data from Jan 20,2014 to Feb 4, 2014 in order
to capture the shooting event (Jan 21) and Super Bowl (Feb 2). After gathering the raw data,
we first performed some text cleaning to eliminate unnecessary words and then used
hierarchical clustering (shown in the dendrogram) to identify the topics we are potentially
interested in studying the social impact.
Text Cleaning
By using “text mining (tm)”[1] and “wordcloud”[2] packages in R, we first performed a series
of data cleaning methods, including remove punctuation, remove numbers, change capital
case letter to lower cases, etc. After cleaning, we then used wordclouds to identify words
that have high frequency. In the following two figures below, words that have high
frequency are marked in bigger fond and are at the center of the cloud. We followed the
same procedures with Super Bowl.
Shooting WordCloud Super Bowl WordCloud
Identifying Topics
After finding high-frequency words, we named four topics for the shooting day. They are
“Shooting”, “Campus”, “Emotions”, and “Cursing Words”. The identification of topics is not
only based on the following dendrogram,but also subjective knowledge of the data. By
doing so, we can compare the frequency of shooting topic to campus and emotional topics
in order to study social impact. For Super Bowl, we simply named it “SuperBowl” based on
the high-frequency words identified on the game day; so we can compare the time course
of the shooting event to a Super Bowl.
Disastrous events have dramatic influence on people. Nowadays, the advent of social media
offers a possibility to track and evaluate the social impact of disastrous events. In this
research, we used data collected from Twitter to evaluate the social impact of Purdue
campus shooting happened on Jan 21, 2014 on local community, and compare the shooting
event with an event occurred in the same time period, i.e. Super Bowl.
We study people’s reaction to the shooting event using tweets.In this section, we will focus
on the following two aspects
• compare the shooting topic with other common topics by word frequency
• compare the time course of shooting event to Super Bowl by word frequency
Shooting Topic vs Common Topcis
Figure 1.1
Figure 1.2
• From figure 1.1, “Shooting”, “Campus”, and “ Emotion” dramatically increased on the
shooting day
• Two days after shooting, “shooting” dropped below 1%, while other common topics stay
at much higher level
• Figure 1.2 confirms with the conclusion drawn from the first figure
SuperBowl WordCloud and Topics
Figure 1.3
By comparing hourly topic decay between the two events (figure 1.2 and 1.3), we can
draw the following observations:
• Two topics directly related to the events both have an increase at the moment when
the event occurs, but “SuperBowl” lasts two hours longer than “Shooting”
• Figure 1.3 does not show no obvious increase in topics other than “SuperBowl”, while
Figure 1.2 shows “Emotions” and “Campus” increase with “Shooting
In order to compare the frequency of words in the “Shooting” topic and “SuperBowl”
topic, we performed an one-side test of population proportion.
As a result, sample estimates of “Shooting” proportion is 0.2138, while the “SuperBowl”
proportion is 0.0945. P-value obtained from the one-side “greater than” alternative
hypothesis is less than 2.2e-16. Therefore, we have significant evidence to state that the
“Shooting” proportion is greater than the “SuperBowl” proportion. In other words, in
terms of frequency, people talked more often about the shooting on the shooting day
than SuperBowl on the game day.
purdue
class
safe
shooting
campus
today
people
lol
stay
love
building
day
school
good
ó
ee
family
normal
time
prayforpurdue
classes
friends
tonight
shot
purdueshooting yeah
prayers
lockdown
boilerstrong
happened
shit
back
shooter
crazy
resume
hope
news
atoc
operations
police
life
great
happen
man
students
ta
team
vigil
make
university
pray
yea
feel
home
lab
lifeatpurdue
person
ve
damn
amp
cancelled
fine
girl
professor
scary
andrew
bad
fuck
nigga
real
thing
thought
engineering
fucking
god
guys
hellll
morning
photography
praying
thankful
things
tomorrow
true
boilermakers
call
gonna
hate
physics
rest
thoughts
wanna
bearden
big
continue
days
hard
ljaysuckafree
rt
stop
threat
wtf
boldt
canceled
care
dead
game
guess
hall
heard
lecture
lmao
makes
miss
ongoing
prof
student
twitter
walking
weather
closed
cold
door
events
gun
happening
hey
inside
leave
locked
lost
minutes
phone
power
room shooters
suspect
textwait
buildings
custody
free
grateful
haha
literally
lock
made
niggas
place
play
strong
tragedy
amazing
armstrong boilerup
doors
dude
felt
friend
funny
happy
madao
prayersforpurdue
purduereview
show
victim
week
year
affected
areabro
calm
candlelight
confirmed
dang
died
dining
dzlam
early
face
find
glad
heart
helicopters
hoping
hour
hours hovde
im
lose
lot
mindnorthwestern
pretty
reported
sad
safety
snow taking
thatkdlovee
watching
west
yo
ass
babyitsyana
birthday
boilermaker
bus
cancel
close
college
community
concern
death
electrical
expect
fact
favorite
feeling
girls
guy
high
involved
jconline
lafayette
left
listening
live
mitch
night
photosby
proud
purduestrong
read
remember
respect
scanner
shots
shut
sitting
smokinmochen
start
supposed
talking
terrible
theoriginals
tweet
watch
win
world
alright
concerns
cool
courts
degrees
di
eat
fellow
gotta
headhit
house
info
kind
klaus
ladies
mad
nah
occurred
onepurdue
playing
pm
question
reason
rip
scared
sick
side
situation
support
thinking
times
told
tv
understand
walk
work
absolutely
active
amount
aribugadi
arrested
baby
boiler
boilermakerstrong
boilers
break
bring
clearcnn
coming
court
deal
degree
deserve
die
dont
ece
elliottkadeemmalucycook
event
fall
fire
found
freezing
fun
hahaha
hayley
hear
hiding
hurt
ice
idk
insane
iu
job
kid
kill
late
light
long
machine
means
mom
msee
number
phi
photo
pic
point
posted
put
rough
semester
set
shaking
shootings
sit
staysafe
stopped
supposedly
throws
unreal
updates
voice
working
worry
wow
wrong
ya
activity
ago
aj
allowed
asks
awful
ball
beautiful
bitch
black
body
boy
brokenmouse
calling
candle
check
classroom
computer
cops
cuz
daniels
dat
due
email
end
explain
fast
fatality
fear
fired
floor
forget
fountain
freaking
give
giving
hahahaha
hail
half
holy
honestly
jimmyclarke
joke
killed
large
leaving
lifted
lives
lmfaooo
loose
lord
losing
luckily
lucky
lunch
madisonschmid
making
mall
matter
message
mine
multiple
nice
officers
pacers
pants
part
perfect
picture
poor
post
ppl
professors
purduesg
quickly
rapgamejason
rayvieray
realize
received
refuse
sasquatch
saturday
schools
send
shaken
shelter
shows
sirens
sleep
solidsoillee
sounds
spend
started
steps
story
stress
stuck
stupid
talk
texted
thinks
tornado
totally
treygrady
tryna
turn
uh
waiting
wake
walked
wearing
word
act
adam
afternoon
agree
alert
alltheway
ameliaedelia
angelap
anymore
apparently
apps
ashleybaldman
asked
asktf
aye
babyboibrooks
basically
basketball
bb
bed
bg
bio
blocked
boo
brings
brogancrosby
broken
brother
called
caution
chanbam
channel
checking
chemistry
clammecullen
cleared
cnnbrk
cody
coltsfan
completely
continuing
cop
couple
cousins
cute
ddt
deep
dinning
dorm
dr
drink
encouragement
erin
excited
excuse
extremely
eyes
ez
faces
feelings
feels
fight
fix
food
foul
fraternity
freaked
front
futureambitionz
gay
getbizzychrizzy
golden
grad
greatful
ha
handle
hkportss
hold
homework
horrible
hrosew
human
hungry
idea
idiot
iheartallie
important
incident
information
injured
innocent
jadorepari
jake
jk
kalieghwut
knew
knowing
laughing
learn
lights
lindalee
lofmeechmitty
loves
madisynel
mandatory
marcel
mcryzzy
members
men
messages
messed
mikedayply
money
move
munchies
nak
nap
nascarwalker
national
neetleo
negiluka
officer
officials
open
ot
passed
peace
pictures
piss
pissed
places
powerful
problem
qiuzhikong
ran
ready
realmikeytaylor
recruitment
reminder
report
respectful
resuming
rez
rifles
rtv
run
scene
schedule
science
season
securitysheltered
shook
shoot
shoutout
showing
smart
sound
special
spent
st
stairs
starbucks
state
staying
stuff
suspects
swear
takes
taught
teacher
teaching
terrifying
test
texts
theres
thor thousandstimeflies
top
tormangold
transfer
trending
triiigga
tuesday
turns
type
unbelievable
update
vehicle
vortex
waking
watkinstanner
ways
wear
weekend
white
winter
words
worries
write
wthrcom
yep
purdue
building
ever
family
friends
boilerstrong
will
tonight
vigil
shit
police
ee
next
never
classes
okay
purdueshooting
lockdown
man
crazy
us
life
great
happened
even
want
well
shooter
news
yea
sure
way
back
need
prayers
come
university
make
hope
happen
students
see
though
re
got
yeah
someone
shot
ta
know
really
school
think
ó
prayforpurdue
campus
normal
operations
resume
class
now
right
lol
thanks
shooting
safe
stay
thank
people
today
one
love
going
good
get
day
everyone
please
can
much
time
20406080100120140
Cluster Dendrogram
hclust (*, "ward.D")
distMatrix
Height
Data
Words included in each topic are:
• Shooting: purdueshooting, lockdown, police, resume, safe, shooting, shot, stay
• Campus: campus, class, purdue, school, university
• Emotions: family, friends, hope, life, love, prayer
• CursingWords: fuck, shit, damn
• SuperBowl: superbowl, peyton, broncos, seattle, seahawks, game, play, bruno mars,
football, denver
Filling Out Word Frequencies
We collected frequency of words in each topic in two different time units. One is a day-
to-day method; done by looking for frequency of words one day before the shooting
day, on the shooting day,and two weeks after the shooting day (total 16 days). The other
is a two-hour moving-window method; done by looking for frequency of words two
hours before the shooting (10am-11am) until 11pm of the shooting day (total 7 moving-
windows). We followed the same procedures for Super Bowl.
Data
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
Topic Decay Over Days (Shooting)
Shooting
Campus
Emotion
Cursing
0
0.05
0.1
0.15
0.2
0.25
10-11 12-13 14-15 16-17 18-19 20-21 22-23
Topic Decay Over Hours (Shooting)
Shooting
Campus
Emotion
Cursing
In this study, we can draw two main conclusions. First, we showed that the topic directly
related to shooting lasts shorter in time than its related social topics. Second, by
comparing Shooting to Super Bowl, we conclude that the former has more influential
power on people than the latter in two aspects. One aspect is that people talk more
often about the shooting than a Super Bowl on the event day, the other is that people’s
emotion can hardly be reflected from a popular event comparing to a Shooting.
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
16-17 18-19 20-21 22-23 24-1 2-3
Topic Decay Over Hour(SuperBowl)
SuperBowl
Campus
Emotion
Cursing
bowl
game
super
esurancesave
broncos
time
peyton
bruno
love
team
ayeeitstimea
commercial
mars
denver
fuck
ó
miss
shit superbowl
half
ll
madao
tonight
seahawks
win
back
play
watch
commercials
give
hahaha
high
mercedesxo night
purdue
show
watching
year
feel
football
friends
great
manning
people
bad
guy
party
ass
family
home
life
real
seattle
things
yeah
years
amp
drunk
facebook
fan
girl
gonna
halftime
happy
hate
makes
man
point
puppy
start
thought
ve
wait
adipppsheep
car care
girls
guess
hot
making
page
pizza
sunday
superbowlxlviii
white
wrong
amazing
atocó
atoc
boy
chicago
cute
defense
excited
food
fun
funny
haha
hard
hours
live
lmao
make
mom
omg
photography
photos
pretty
put
red
sad
sb
suck
taste
tweet
twitter
weekend
amandakuffell amount
anymore
arrianaagee
big
bird
bit
call
chili
dem
em
face
flappy
god
hahahaha
head
late
literally
lord
lose
luck
made
money
peanutkuma
playing
reason
rock
springdrinkee
stop
stupid
tebow
thing
thinking
tho
told
turn
weeks
wins
world
worth
yo
baby
bed
boys
bruh
class
crazy
da
damn
dead
dude
essay
fact
false
fam
fans
feeling
found
fuckin
gotta
gt
harry
homework
horrible
hour
itsscat
job
language
lay
longer
lot
mad
molly
months
ónaco
open
outoftheusual
pay
peppers
perfect
physics
played
potter
pughkyle
puppybowl
question
quote
rhcp
rocks
room
run
sleep
smh
sports
statement
stayexcellent
tomorrow
wanna
wilson
winter
words
work
worst
yea
ago
am
american
annakaras
annarose
avril
awvarvel
baltimore
beautiful
bout
bronco
bunch
buy
called
calling
camwow
change
chrismahank
cliff
coach
college
colts
coming
completely
confused
cry
crying
dad
eat
emotions
enjoy
enjoying
finally
fine
forgot
freaking
friend
fucking
gobroncos
gross
guys
hahah
happen
heard
hearing
heart
hit
hoffman
holy
huh
ice
iu
jakeewhiteyo
jk
john
josseeb
key
killing
kind
lame
listen living
lost
lt
malloryhouse
maneitszane
marketing
masuk
mess
mine
minimum
mon
movie
music
nagromrong
needed
nfl
nice
nickcarlson
nigga
nope
number
nyampe
official
person
pet
philip
players
points
proud
ravensnation
realizerent
respect
rest
rooting
ruined
running
s
scarygrandpa
score
seconds
sethmeyers
sex
seymour
sherman
short
sing
smahasena
smoke
soul
states
story
taking
talked
terrible
throwback
times
totally
tpletcher
ugly
uh
understand
united
watched
west
winning
working
wow
ya
yal
yourfriendanna