chrMongeau / repec-twitter

RePEc
8 stars 0 forks source link

RePEc economists on Twitter

This repository has two (main) R scripts:

All is CC-BY-NC-SA.

In order to use the Twitter API, you need to create a "Twitter App". Follow the instructions at http://rtweet.info/articles/auth.html.

list.R

This R script is used to update the list at https://twitter.com/chrMongeau/lists/repec-twitter. It downloads the list members and the list of all the economists listed at https://ideas.repec.org/i/etwitter.html. New members are added to the Twitter list (when the list is updated, a reply is sent to the original tweet: https://twitter.com/chrMongeau/status/706873909484851200).

network.R

This R script creates an interactive network of RePEc economists on Twitter. It download the members listed at https://twitter.com/chrMongeau/lists/repec-twitter and retrieve some information about them from their pages at https://ideas.repec.org/. Specifically, it extracts the following information:

Moreover, the following information from Twitter is retrieved:

The network is built by querying the list of users' "friends", which in Twitter parlance means "people followed". If person A follows person B, a (directed) link is created. Edges are weigthed and their value is given by nodes similarity calculated from NEP fields (see below).

NEP fields

These fields (see: https://ideas.repec.org/n/) are extracted in order to compute the (cosine) similarity among economists. This measure -- which goes to zero (no fields in common) to 1 (all fields in common) -- is then used to give a weight to the network. This is useful for grouping economists by research fields, as the layout algorithm (see beolow) accounts for weights.

Main NEP field

The field with the highest frequency is assigned as "field". Economists with more than one main field (i.e., cases with ties) are given a random field chosen between the main fields (this is probably not optimal, but the option was to assign a NA to the field, which doesn't seems a wise thing to do).

Affiliation

Affiliation is the one with the highest percentage. If no percentage is reported, it is the first one.

Network plotting

The network is exported in a graphml file that is read into Gephi and some manual tweaking is done there. These are the steps:

The last step requires you have the Sigmajs Exporter plugin: https://marketplace.gephi.org/plugin/sigmajs-exporter/

In the Sigma.js Export dialog, the following items were filled:

Finally, some tweaks were done for a better visualization.

Where is the data?

Initially I thought about sharing the data from Twitter and RePEC, but I reconsidered this idea because I don't feel confortable in sharing personal information (even if it is publicily available!). You'll need to use the script to download the data. It will require some time, as Twitter has some limits on the numbers of API queries.