Who is important in the conversation?
Different measures of centrality all try to get at the similar concept of "which vertices are most important." As we discussed earlier, these two metrics approach it slightly differently. Keep in mind that while each may give a similar distribution of centrality measures, how an individual vertex ranks according to both may be different. Now we're going to compare the top ranking vertices of Twitter users.
The vectors that store eigen and betweenness centrality are stored respectively as retweet_ec and retweet_btw.
Diese Übung ist Teil des Kurses
Case Studies: Network Analysis in R
Anleitung zur Übung
- Calculate the
0.99quantile of the betweenness,retweet_btw. - Subset
retweet_btwfor values greater than this quantile to keep the top 1%. - Do the same for eigen-centrality,
retweet_ec. - Run the code that puts these in a data frame and look at the results.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Get 0.99 quantile of betweenness
betweenness_q99 <- quantile(___, ___)
# Get top 1% of vertices by betweenness
top_btw <- ___[retweet_btw > ___]
# Get 0.99 quantile of eigen-centrality
eigen_centrality_q99 <- ___(___, ___)
# Get top 1% of vertices by eigen-centrality
top_ec <- ___
# See the results as a data frame
data.frame(
Rank = seq_along(top_btw),
Betweenness = names(sort(top_btw, decreasing = TRUE)),
EigenCentrality = names(sort(top_ec, decreasing = TRUE))
)