To investigate the dynamics of social networks and the formation and evolution of online communities in response to extreme events, we collected three datasets from Twitter shortly before and after the 2011 earthquake and tsunami in Japan. We find that while almost all users increased their online activity after the earthquake, Japanese speakers, who are assumed to be more directly affected by the event, expanded the network of people they interact with to a much higher degree than English speakers or the global average. By investigating the evolution of communities, we find that the behavior of joining or quitting a community is far from random: users tend to stay in their current status and are less likely to join new communities from solitary or shift to other communities from their current community. While non-Japanese speakers did not change their conversation topics significantly after the earthquake, nearly all Japanese users changed their conversations to earthquake-related content. This study builds a systematic framework for investigating human behaviors under extreme events with online social network data and our findings on the dynamics of networks and communities may provide useful insight for understanding how patterns of social interaction are influenced by extreme events. U nderstanding how human social behavior changes in response to extreme events like earthquakes, tsunamis or terrorist attacks is key to emergency response and recovery 1, 2 . In this paper, we consider the subset of human behavior that is demonstrated in the patterns, context and content of interactions between individuals, especially those mediated by internet enabled devices. Observations of this behavior during extreme events may provide insights into general behavior patterns during times of stress because links between unobservable decisions and the observable actions taken in response to those decisions are more likely to be temporally close due to the time sensitive nature of many extreme events. However, the study of human behavior during extreme events has historically been hindered due to the limitation of available information during such scenarios 1 . Studies of behavior during extreme events have primarily been made retrospectively, e.g., through field surveys or census sampling after the event 3 . For example, Elliott and Pais studied Hurricane Katrina's influences on a wide array of survivors' responses, including evacuation timing and emotional support to housing and employment situations and plans to return to prestorm communities 4 . Souza et al examined changes in the mental health status of vulnerable communities after the 2004 Indian Ocean earthquake and tsunami 5 . While retrospective studies are critical for understanding human behavior, limitations are also obvious: first, retrospective studies are often made long after the event and cannot provide timely support for decision making when the need is most urgent; and second, data is collected through surveys or interviews, introducing bias due to reporting errors, recollection bias, and challenges identifying and accessing disaster-affected populations. To overcome these issues, researchers have recently used more objective and timely data, generated from sensor networks such as cell phone towers, to track individual mobility and population flow for large populations in real time, providing a unique solution for disaster response and relief management Retrospective surveys and time-location based data improves our ability to investigate human psychological and physical behavior under disasters. However, they do not provide insight into patterns of human interactions and social behavior. For example, when a disaster happens, what do people do as part of a social group? What is the role of each individual and how do they interact with people around them? How are patterns of interactions during extreme events different from those during more typical conditions? The rapid development of online social networking services has enabled researchers to answer these questions: with internet-enabled devices, any user can post and share news, events, thoughts, and the like, providing not only the content of individual psychological and physical activities, but also the context of human interactions such as the target and topic of interaction. When the regional physical telecommunication system still functions after an adverse event, the use of these online tools increases enormously, demonstrating their salience for real world interactions and information sharing behavior. Although the population that regularly uses internet-enabled devices to communicate is not representative of the population as a whole, the records of those interactions do represent a window into social behavior that has not previously been observable. Thus, studies relying on real-time records of interactions complement but do not replace existing retrospective analyses. These real-time perspectives provide more breadth of data on patterns and content of interaction behaviors, with the limitation that the only data available are those interactions that are mediated by internet-enabled devices and so are not representative of all social interactions. Studies of online social media under adverse events were pioneered by utilizing data from Twitter, a leading micro-blogging service which allows users to rapidly communicate information in up to 140 characters (tweet) on a one-to-one, specified group or global basis 8 . The temporal, spatial and social dynamics of Twitter activity have intrigued many researchers in developing applications to facilitate early event detection and increase situational awareness 9, 10 . The behavior observable through Twitter is not representative of all social interactions but we believe that it does have the potential to show how extreme events influence patterns of interactions, despite the challenges in obtaining representative samples. The US Geological Survey (USGS) has found that when an earthquake is felt by a population that uses Twitter, tweets reporting the incidence of an earthquake are published online sooner than the 2 to 20 minutes it takes the USGS to publicly distribute instrumentally derived estimates of location and magnitude . In an evaluation implemented by Paul et al, the authors found that tweets referencing earthquakes may be useful information for detecting earthquakes in poorly instrumented regions Understanding changes in patterns of user activities during extreme events requires dynamic analysis of how individuals communicate with others before and during an extreme event and the communities they interact with 15 . Interactions can be mapped into a network structure where nodes are individual users and edges are records of interaction between two users. Community structure can be observed through patterns of coherent and sustained interactions between groups of individuals. Despite many studies focusing on tweeting activity and text mining, studies analyzing behavioral interactions under extreme events have been rare. Preliminary studies have been made, for example, by Gupta et al., who proposed a clustering algorithm in detecting user communities and applied the method in analyzing Twitter users in three major crisis events of 2011 (Hurricane Irene, Riots in England, and Earthquake in Virginia). They found that top users represent the topics and opinions of all the users in the community with 81% accuracy on an average 16 . In the 2010 Chile earthquake, Mendoza et al. analyzed information propagation on Twitter network and found that rumors tend to be questioned more than news by the Twitter community 17 . In a recent study, Chatfield and Brajawidagda conducted a social network analysis of Twitter information flow among the central disaster warning agency's (BMKG) Twitter followers during the 2012 Indonesia Earthquake and found that even with less than 0.1% of all followers re-tweeting the initial reports, tsunami early warnings released by BMKG could potentially reach 4 million users in 15 minutes 18 . There are preliminary analyses of human interactions through Twitter under extreme events from a network perspective in the existing scientific literature. However, current research lacks a systematic framework to characterize the mechanisms and pattern changes observed in social interactions during adverse events. To investigate the dynamics of social networks and the formation and evolution of communities in response to extreme events, we collected three unique datasets from the weeks before and after the March 11 th , 2011 Japanese earthquake: 1% of all tweets posted worldwide, sampled approximately uniformly from Twitter using the ''Spritzer'' API, which we refer to as the Global dataset; tweets written in Japanese that were sampled from the ''Topsy'' API, which we refer to as the TP-JP dataset; and TP-EN: tweets written in English and sampled from the ''Topsy'' API (See Materials and Methods for details). Hereafter, we refer to people who communicate online in Japanese as Japanese speakers, but they are not a representative sample of all people who speak Japanese, or all people who were affected by the earthquake. Nonetheless, we believe that changes in the behavior of this Japanese speaking population in response to the earthquake and tsunami can provide some insight about changes in social behavior in Japan in response to the earthquake and tsunami. We consider the TP-JP dataset to represent a treatment group, because a larger proportion of this groups population was affected by the earthquake than the populations of the other two datasets. Thus, changes in the structure of the TP-JP network before and after the earthquake that did not also occur in the TP-EN or Global dataset are likely related to the events that influenced Japanese speakers on twitter. We are using a broad dataset intended to preferentially select the population of people who are affected by the earthquake, and examine at how their social interaction patterns change for the broad population affected by the disaster. In this sense, we are looking at population level changes in patterns of social interactions, rather than using records of online interactions to trace details of events, information discovery, coordination efforts, and emergency response [19] [20] [21] . The detail-oriented approach of this crisis-informatics research is crucial for developing effective real time emergency response strategies and planning efforts. Understanding changes in social interaction patterns in response to an adverse event may provide insight into how patterns of interaction behaviors change in response to stress, which could inform planning disaster response efforts that deal with behavior at a population level; for example evacuation procedures or information dissemination. By comparing network and community structure before and after the earthquake, we were able to examine the effects of the earthquake on networks of communication in social media. We find that while almost all users demonstrate increased activity after the earthquake, Japanese speakers expanded their network of interactions to a much greater degree. Japanese speakers are more likely to be directly affected by the earthquake than a person who uses another language. By applying the community detection algorithm of information mapping (Infomap) 22, 23 , we find that the behavior of joining or leaving a www.nature.com/scientificreports SCIENTIFIC REPORTS | 4 : 6773 | DOI: 10.1038/srep06773 2 community is far from random. In the week following the earthquake, Japanese speakers and users globally were more likely to have remained in the community they were in before the earthquake than would be expected if community structure were randomly generated. Additionally, users were much less likely to join new communities from a solitary pre earthquake state or shift to other communities from their current community. Additionally, we find that while nonJapanese speakers did not significantly change the content of their conversations relative to the pre-earthquake topics, nearly all Japanese speakers changed their main conversation topic to earthquake-related content. This study builds a systematic framework for investigating human behaviors and social interactions during extreme events with online social network data. The findings on network dynamics and community evolution may provide useful insight for our understanding of collective human behavior in future studies. Network data. nd there was a server error and no data was collected. In order to maintain day of week symmetry in the before and after dataset, we also exclude Wednesday, March 16 th . This dataset results in 14.2 million messages and is hereafter referred to as Global. Unfortunately, the data was recorded in ASCII, which is sufficient for content analysis when users write in the Latin alphabet, but does not permit content analysis or language estimation when users write in language that does not use the Latin alphabet, especially Japanese. For this reason, the following dataset is also used for a more detailed analysis of content changes in Japanese language tweets. Topsy. We used the API interface to the website www.topsy.com to search for the largest possible subset of tweets in English and Japanese for the seven days before and after the earthquake. We searched on the 6 most commonly used hiragana characters: , , , , , and . to retrieve Japanese tweets (TP-JP) and the six most common words in English language to retrieve English tweets (TP-EN): ''the'', ''be'', ''to'', ''of'', ''and'', and ''a''. For the Japanese language search, this method returns between 100 and 400 tweets per hour before the earthquake, and 300 to 1500 tweets per hour after the earthquake. For the English language search, between 300 and 600 tweets per hour were returned for the entire study period. Inferring the geographic origin of individual tweets is challenging . We rely on the geographic concentration of Japanese speakers in Japan to develop a sample of tweets written by people who are likely to be affected by the earthquake. Ninety-nine percent of all people for whom Japanese is a first language live in Japan 27, 28 , and so searching just by the Japanese language will preferentially select people who were affected by the earthquake, especially in comparison to people speaking English on Twitter, as in our TP-EN control group. Those who use Japanese to communicate on Twitter are likely to be socially connected to those in Japan, and thus influenced by the earthquake either directly or indirectly through social ties to people in Japan. We consider the TP-JP dataset to represent a treatment group, because a larger proportion of this groups population was affected by the earthquake than the populations of the other two datasets. Thus, changes in the structure of the TP-JP network before and after the earthquake that did not also occur in the TP-EN or Global dataset may be related to the events during the study period that influenced Japanese speakers more significantly than people who speak other languages, especially the earthquake and tsunami. Network formation. Each node in the network represents a single Twitter user who sent or received tweets in the sample dataset. Each user is uniquely identified by a Twitter handle, which must contain only Latin letters and underscores. The first character of all Twitter usernames is the @ symbol. A directed link from A to B is formed when user A writes user B's username in the posted content by either mentioning B directly or by forwarding a tweet written by B, called a retweet. The number of times A mentions B in all tweets from the study period is used as the link weight. In the end, 36,893, 36,234 and 7,403,050 unique users were obtained from the TP-JP, TPEN and Global datasets, respectively. This is shown in Table 1 . Data is sampled from posted tweets rather than from a full list of users and so it is important to follow the behavior of each user individually to evaluate the effect of the earthquake. We thereby focus on users who were included in the sample both before and after the earthquake. After this filtering, we obtained 3,647, 4,037, and 87,939 nodes, respectively. Due to the limited sampling rate in TP data, the resulting networks are relatively sparse. For the purpose of network and community analysis, we dismiss link direction and weight in the TP-JP and JP-EN networks, collapsing the data to an undirected unweighted network. We maintain the weighted and directed network for the Global dataset. In the Global dataset, outdegree refers to the number of tweets sent by a given user that refer to another user by name. Community detection. We apply the Infomap method 22, 23 to detect the underlying community structures in the TP-JP, TP-EN networks (undirected unweighted) and the Global networks (directed weighted). The Infomap method is built based on optimizing the minimum description length of the random walk on the network. It takes advantage of the duality between finding community structure and minimizing description length of a random walker's movements on a network. With a random walker as a proxy for real flow, the minimization over all possible network partitions reveals important aspects of network structure with respect to the dynamics on the network. Infomap has the advantage of being flexible for finding community structures on both undirected and directed, weighted and unweighted networks, it has also shown that it is one of the most efficient, reliable and accurate community detecting method in comparison to a range of other models [29] [30] [31] . For these reasons, it has been becoming the state of the art and has been increasingly used in the detection of network communities in empirical studies 30, 32, 33 . Categorize network dynamics. Community dynamics. We propose a framework for modeling the dynamics of communities using the following five processes. In the time between t and t 1 1, a community can dissolve, form, survive, split or merge. Let s t i be the size of community i at time t, and s tz1 ij be the number of nodes, or users, who shift from community i to community j between time t and t 1 1. Then: Community i survives if a sufficiently large proportion of its nodes remain in the same community at time t 1 1. Formally, any community j (1 # j # m . s tz1 j §k 1 , where m t11 is the total number of communities detected at time t 1 1, and k 1 is the constant threshold of the proportion of nodes that must remain active in community j for that community to be defined as having survived from time t to t 1 1. In this case, we define all destination communities as having also survived. Community j dissolves between time t and t 1 1 if only a small proportion of its nodes remain in the same community at time t 1 1. Formally, for any community j at . s tz1 j vk 2 , where k 2 is the constant for setting the threshold of the minimum proportion of nodes that must remain in community j for that community to remain active and avoid dissolving. Thus, k 2 must be less than k 1 . Finally, if a community at time t does not survive or dissolve in time t 1 1, it has split, and if a community in time t 1 1 does not survive or form, it has merged. In our analysis, a community can dissolve, survive or split in time t, and can form, survive, or merge in time t 1 1. To avoid including many communities with very few nodes, we limit our analysis to communities with at least s nodes. Node dynamics. Similarly to community dynamics, the dynamics of individual nodes can be modeled according to their status in a community. There are five possible behaviors for each node between time t and time t 1 1. A node may stay-solitary if it does not belong to any community in time t or time t 1 1; a solitary node at time t may join a community at time t 1 1; a node that belongs to a community at time t may stay-social, by remaining in the same community at time t 1 1, jump to another www.nature.com/scientificreports SCIENTIFIC REPORTS | 4 : 6773 | DOI: 10.1038/srep06773 3 community, or leave the community and become solitary. These behaviors are shown graphically in Fig. 1 . We investigate the distributions of the five forms of community evolution and five forms of node behavior by varying the minimum size s for a community to be analyzed, with k 1 5 50% and k 2 5 10%. Content analysis. In order to estimate the most important and relevant conversational topics for the largest communities in each time period, tweets were stripped of all punctuation except Twitter relevant indicators: #, @ and _, and the frequency of all remaining words was counted. For non-Japanese tweets (Global and TP-EN), three categories of words are filtered out: common English words, common Twitter phrases, and common words in non-English languages. First, the 50 most common English language words are excluded. Second, the 25 most common words in the TP-EN dataset are excluded, most of which are fragments of web addresses and other meaningless words. Finally, the 50 most common words in the Global dataset are excluded. In the Global dataset, because only ASCII characters were retained, most of the content for users writing in a language that does not use the Latin alphabet was lost, particularly Korean and Japanese content. Because Twitter usernames can only contain the 26 letters of the Latin alphabet and the underscore character, the network structure is still observable for all language groups. One consequence of this data collection challenge is that the most frequently used words remaining in the dataset of communities using a non-Latin alphabet are usernames. Written Japanese does not have spaces between words. As a result, tokenization to break sentences into words is challenging. We used Mecab 34 , which is a morphological analysis system for Japanese language, to parse the Japanese tweets 35 . After tokenization, the 50 most common words in the TP-JP dataset were removed. This still left a large number of word fragments and meaningless words as some of the most frequently used words in each cluster. With assistance from a native Japanese speaker, the top twenty most frequently used meaningful words were retained for each cluster in time one, before the earthquake, and time two, after. Basic network characteristics. Characterizing the Japanese network before and after the earthquake shows clear increases in Twitter use, directed communication, and the global clustering coefficient that is not observed to the same extent in the TP-EN or Global dataset (See Table 1 and Fig. 2 . In all metrics, changes in the TP-EN dataset closely mirror the changes in the Global dataset, which supports the validity of Topsy's sampling method. The number of tweets collected in the TP-JP dataset increased by 68% after the earthquake, while the number of tweets increased by 31% and 30%, respectively, for the TP-EN and Global datasets. While Twitter use increased for all networks, it increased to a greater degree for Japanese speakers than it did for English speakers and those in the Global dataset. In addition to the simple rate of Twitter use, the rate of directed communication (the number of links) increased by 477% in the TP-JP dataset and only 32% and 35% for the TP-EN and Global datasets respectively. This shows that for non-Japanese speakers, the rate of directed tweets, those mentioning another person by name, compared to all tweets stayed consistent in both the TP-EN dataset and the Global dataset before and after the earthquake. For Japanese speakers, the rate of tweets that are directed at a particular user, out of all tweets, increased from 54% of all tweets to 98% of all tweets, indicating that the number of people they were in direct contact with expanded to a much greater extent than did their raw increase in posts. For all three datasets, the increase in the number of tweets and number of links contributes to an increase in the size of the giant connected component. However, the clustering coefficient remained constant for the English tweets, and increased from 0.06 to 0.09 for Japanese data. Thus, after the earthquake, the Japanese social network was much more densely connected than it had been before the earthquake even though there was no measurable change in the density of the other two networks. This continues to suggest that the observed changes in the Japanese social network were caused by the earthquake and related events, and implies changes in patterns of interacting behavior that are independent of just increased communication volume. Dynamics of online activity. We start with the degree distribution, as shown in Fig. 3 , to investigate the dynamics of users' online activity. We can see that on all networks the degree distributions are skewed, with a small percentage of nodes possessing a large number of links in the network. In both the Global and English datasets, the change in degree distribution is very small, while the Japanese network shows a significant increase in the degree at all levels of the distribution: the increase occurred across all types of nodes and included both those that were initially very connected, and those that were less connected. The average degree increased from 2.8 to 5.7 (see Table 1 ). The changes in interaction patterns at the individual node level before and after the earthquake are presented in Fig. 4 . We can see that there is no meaningful change for the Global indegree (number of links pointing to a node), outdegree (number of links starting from a node), and for the TP-EN network. However, the Japanese network shows significantly increase in degree after the earthquake. This is consistent with the aggregate behavior demonstrated in Fig. 3 . No matter how active a Japanese user was in communicating directly with others on twitter before the earthquake, s/he is likely to have increased the number of people s/he communicated with after the earthquake. Community evolution. Dynamics of communities. The above analysis on network density and node degree shows that individuals in the Japanese network became more active in posting tweets and interacting with others after the earthquake. To further investigate these changes in social behavior, in this section we evaluate the dynamics of communities: the social groups which are formed among intensely interactive users and are detected by the Infomap algorithm 22, 23 . To identify significant patterns, we generate a null hypothesis scenario in which the size distribution of communities is fixed both before and after the earthquake, but each user joins some detected community at random after the earthquake. Based on changes in each users community between the truly observed community in the in the before case and the null hypothesis scenario in the after case, the number of communities that survive, dissolve or form, and split or merge is then plotted in Fig. 5 . We can see that in the true data, for all networks, a number of communities survived after the earthquake, a phenomenon which cannot be observed under the random participation assumption. In communities that survived, users stayed in contact with a similar group of people, despite the strong effect of earthquake. The Japanese network had fewer communities that survived than the English network did: In the Japanese network, only three communities survived after the earthquake under a community size threshold, s, of 10, under a community size threshold of 60, only the largest community survived. The relatively small number of sustained communities in the Japanese dataset indicates that the earthquake imposed a strong force in disrupting online user activities. It is possible that after the earthquake, users were likely to change their conversations towards topics that were socially universal at that time, such as news transfer, disaster response and relief work. Additionally, the expansion of personal networks due to highly increased volume of mentioning and retweeting other users could also lead to the failure of members to remain in their own isolated communities. For all three networks, the number of communities that survived is larger than the null model, and the number of communities that dissolved or formed is substantially smaller than the null model. This shows that even though interactions between users were significantly increased under these extreme events, most users remained in their original communities, and did not shift to other communities, which demonstrates the coherence of online social groups. Although the direction of difference between data and the null model is the same for the Japanese, English, and Global datasets, the magnitude of difference is larger for the English and Global datasets than for the Japanese dataset. This may show that while
A very important study that builds a systematic framework for investigating human behaviors under extreme events with online social network data extracted from Twitter was carried out in REF .
Network Structure and Community Evolution on Twitter: Human Behavior Change in Response to the 2011 Japanese Earthquake and Tsunami
Scientific Reports
Scientific Reports
Sociology Medicine