![]() ![]() Recall that matrix multiplication entails multiplying the k-th entry of a row in the first matrix by the k-th entry of a column in the second matrix, then summing, such that the ij-th row-column entry in resulting matrix represents the dot-product of the i-th row of the first matrix and the j-th column of the second. To convert a two-mode incidence matrix to a one-mode adjacency matrix, one can simply multiply an incidence matrix by its transpose, which sum the common 1’s between rows. Suppose we wish to analyze or visualize how the people are connected directly - that is, what if we want the network of people where a tie between two people is present if they are both members of the same group? We need to perform a two-mode to one-mode conversion. Run this in R for yourself - just copy an paste into the command line or into a script and it will generate a dataframe that we can use for illustrative purposes:ĭf <- ame ( person = c ( 'Sam', 'Sam', 'Sam', 'Greg', 'Tom', 'Tom', 'Tom', 'Mary', 'Mary' ), group = c ( 'a', 'b', 'c', 'a', 'b', 'c', 'd', 'b', 'd' ), stringsAsFactors = F ) df person group 1 Sam a 2 Sam b 3 Sam c 4 Greg a 5 Tom b 6 Tom c 7 Tom d 8 Mary b 9 Mary d Fast, efficient two-mode to one-mode conversion in R Here’s a short example of this kind of data. Another very common example of two-mode network data consists of users on a particular website who communicate in the same forum thread. For example, a two-mode network might consist of people (the first mode) and groups in which they are members (the second mode). Bipartite/Affiliation Network DataĪ network can consist of different ‘classes’ of nodes. Much of the material here is covered in the more comprehensive “Social Network Analysis Labs in R and SoNIA,” on which I collaborated with Dan McFarland, Sean Westwood and Mike Nowak.įor a great online introduction to social network analysis see the online book Introduction to Social Network Methods by Robert Hanneman and Mark Riddle. I recently updated this for use with larger data sets, though I put it together a while back. This post introduces bipartite/affiliation network data and provides R code to help you process and visualize this kind of data. It might be useful analyze common group membership, common purchasing decisions, or common patterns of behavior. Data can often be usefully conceptualized in terms affiliations between people (or other key data entities). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |