A blog on statistics, methods, philosophy of science, and open science. Understanding 20% of statistics will improve 80% of your inferences.

Sunday, December 13, 2015

Plotting Scopus article level citation data in R

The Royal Society has decided to publish journal citations distributions. This makes sense. The journal impact factor is a single number trying to summarize a distribution, but it’s almost always better to plot your data. Some have been hopeful that visualizing such distributions will make it clear what a troublesome statistic the journal impact factor is, and hope that other journals will also be open with their data.

I want to point out that all this data is readily available to anyone who has access to Scopus, and at the bottom of this post I’ll share the R code to create these plots yourself.

Go to Scopus, and search for any journal you’d like. Here, I’ll illustrate this process by a search for the journal Psychological Science, which has ISSN number 0956-7976. You can search for any range of years, but Scopus will only allow you to export 2000 cases at once. I limited this search to issues from 2010-2015.Due to copyright reasons, I cannot share the Scopus data I downloaded.

Then, select all results, and export ‘all available information’ as a .csv file, as illustrated in the animation below.

Now you have the data, plotting the citations is straightforward, and can be done with the code below (the plots in this blog posts look a bit different then the output in the code, but the data is the same). For example, here is the distribution of citations for Psychological Science for the years 2010-2015. The tail is so long, that I cut off the x-axis at 200 citations. Three (most notably, Simonsohn, Nelson, & Simmons, 2011, with 662 citations) papers are cited more than 200 times.

The data is clearly skewed, and obviously papers are cited more often, as the years go by. The differences between the means:

        Year    Mean
1       2010    34.551724
2       2011    25.329167
3       2012    18.460465
4       2013    12.055016
5       2014    6.176471
6       2015    1.814815

and medians:

        Year    Median
1       2010    25
2       2011    17
3       2012    15
4       2013    8
5       2014    4
6       2015    1

are obvious. You would probably exclude extreme outliers when analyzing your own data, but journals obviously like to keep them in because they boost the impact factor, even though they are not representative.

Feel free to play around with the script, and link to your plots in the comments below, or tweet them to me at @Lakens.

Friday, December 11, 2015

Can you explain why you did not share data and materials when publishing your article?

I recently signed the Peer Reviewers’ Openness Initiative. At its core, it boils down to one very simple thing: As a reviewer, I will from 2017 onwards ask authors to explain why they can not share their data and materials. Without an explanation, I will choose not to review this specific article. 

In Peter Singer’s ‘The Life You Can Save’ (2009) he describes a simple situation. You walk past a shallow pond where you see a small child who is in danger of drowning. No one else is around, but you can easily save the child if you act immediately. You won’t have time to take off your shoes, and the shoes you are wearing will be ruined, and no one will refund them. Will you save the child at the expense of your shoes?

The answer many people give is: “Yes, sure”. Peter Singer goes on to argue that the same amount of money you would be willing to spend in this situation, could be used right now to save the life of children somewhere else in the world.

Why this story stuck with me, because it forces you to explain your behavior. Why don’t I give more to charity?

I personally think it is important to be able to rationalize some important behaviors I perform. When it comes to my work, which is paid for by taxpayers, I feel I need to give them optimal value for their money. When I share my data, stimuli, and materials, science will become more transparent and efficient. If I don’t adhere to these open science principles, I think I need to give an explanation. That’s why from 2013, most of the data, materials, and scripts of papers I was a first author or co-author on are publically available.

As in Peter Singer’s scenario, the rationalization not to do something is sometimes difficult, and sometimes easy. If you don’t have enough money as it is, you don’t have any money to donate to others. Similarly, if you can not share materials, such as the IAPS pictures I used in Lakens, Fockenberg, Lemmens, Ham, & Midden, 2013, the justification is easy. At other times, such as when you are considering spending money on gadgets you don’t really need, or when the materials and data have no copyright or privacy issues, you might be affectively inclined to come up with an excuse, only to realize they don’t hold up after careful deliberation.

It’s this latter category we aim to address with the Peer Reviewers’ Openness Initiative. It is so easy to just ignore this rational justification process when you are a little busy. The goal is to make people ask themselves: Could I share the data, materials, and stimuli? Would doing so make science more transparent and efficient?

I’ve started send out tweets to let you know how many papers I review share all data and materials, or explain why this was not possible. So far, I’m at 3/3. After all, journals like PLOS already ask authors to specify the reasons for restrictions on public data deposition in line with the PRO initiative (they just don’t ask authors to include stimuli or materials whenever possible). I have a strong conviction that researchers want to do what is best for science. Every now and then, we just need someone who asks us to reflect upon, and explain, our behavior. 

If you want to help remind researchers they need to rationalize why they are not sharing data, materials, and stimuli, you can sign the PRO initiative here.

For other views related to the Initiative, see blog posts by Richard Morey, Candice Morey, and Rolf Zwaan.
[Read the paper -- Sign the Initiative -- More resources for open science]

Thursday, December 3, 2015

Zotero – Finally a Good Reference Manager

If you are from my generation, you know what UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A START means, your first e-mail account ended with hotmail.com, and the first five times you tried to use a reference manager, it sucked up so much time you were better off setting type by hand.

The fifth reference manager I tried, in October 2010, was Zotero. It wasn’t user friendly, had limited options, and I soon dismissed it like all the others.

But recently, thankfully, some people pointed my attention to Zotero again, and said it worked great. In first instance, I categorized them as people who will even say GitHub is user-friendly. You know, because they are tech-savvy youngsters who programmed in Minecraft on their iPad when they were 5.

But Zotero is great, and I’m so excited I just need to tell you some of it’s great features before you, like me, go on without it because you still think nothing can beat copy-pasting references by clicking Google Scholar’s ‘cite’ button.

Zotero has a standalone app. You can download it here, but be sure to also install the extension for the browser you use. If you load a webpage that has a scientific article on it, a symbol (either a folder, or a page) will appear in the browser bar. 
If you click it, Zotero will automatically add the reference to your database. If you thought that was cool, wait until you see that Zotero also automatically downloads the PDF file (if you have access to it). If you use it on Google Scholar, and there’s a link to a PDF file there, Zotero will also download the PDF file (see below).

That’s right. In one click, you have the reference, and the PDF file stored in your database. See the .gif below that illustrates this process.

Talking about the database: wouldn’t it be nice if the database could be synced across multiple computers? It surely would, and it surely can!

Set up a box account. It will give you 10 GB to sync (which should be enough) for free. The Zotero servers will only allow you to sync 300MB for free, which is enough for the database, but not for the attachments. Create the account, and use dav.box.com/dav and your account name and password to sync (see below). Wait for everything to sync (I had 3 GB, which took a while), and then you can download the files to a second PC.

If you already have a large number of PDF files on your computer, just drag them into Zotero, select them, right-click, and choose ‘Retrieve Meta-data for PDF’ (see the .gif below). Zotero will recognize most (but not all) PDF files. If you have a few thousand articles, Google Scholar (which it uses) will block you for a day. Be patient, and spread out the automatic recognition over a few days.

Obviously Zotero comes with an easy to use add-in for word, and adding references and the bibliography is really easy (in any citation style you want – it has APA 6th edition). After enabling PDF indexing in the options, you can use Zotero for a super fast search through the content of all PDF files in your database. You can also create groups – I created two, one for each PhD student I supervise, so I can easily share papers I come across with them when I think they should read them, and vice versa.

In short, I’m completely sold. I was missing out on a great tool. Thanks to Maarten Derxen and Mark Dingemanse for convincing me to try Zotero again. 

Are there some cool features of Zotero I missed? Let me know in the comments!