Statistical Software Popularity on Google Scholar

Several months ago, my boss and I were discussing how he got the data for his software popularity article; the rest of the background discussion pertains to those plots, so I would recommend going over to take a look before continuing on (or just skip to the next section if you’re impatient). Specifically, we were talking about his figures 7 and 11. Basically he was manually performing searches and recording whatever value he was interested in—by hand—like some kind of barbarian. This is a bad idea for at least 3 reasons:

It’s a waste of time to scrape the web manually. Writing a web scraper, especially if what you want to scrape is very uncomplicated (as is the case here), is easy in pretty much every scripting language. Spending a little time up front in developing a scraper will quickly pay dividends.

If you ever want to change your operational definition (in this case, these are effectively the search queries), then you have to go grab all the old data. This is especially awful if you are trying to get a sense for how things perform over time (as we are here). With a scraper, this is no problem. By hand, this could be hours of laborious, menial work.

This is the reason computers were invented! Put down that mouse and open up vim! (I have heard that emacs has similar capabilities to vim, although unfortunately I was never able to test this myself since I could not find the text editor in the emacs operating system).

There’s another good reason to do this with a scraper instead of by hand, but it is more specific to our particular task. Search engine queries are not going to produce the same results across different days. It just doesn’t work that way for a whole host of reasons. So if, as here, you decide to look at the number of Google Scholar hits for various searches across years, you have to grab all years at once for a sort of “snapshot” in time of how google is deciding to index things on that day. If you grab historical data and slowly build on it (as had been done), then any inference is dubious.

For that matter, it is probably a good idea to point out that this data is a description of exactly what we are saying; it is an examination of Google Scholar hits for various queries. I would hesitate to say that this describes the world of publishing at large, although given Google’s monstrous scope in all things they do, I would not be surprised if this were such a reflection (I’m just not claiming that it is!).

Additionally, again given that search engines are, as far as the end user is concerned, mystical voodoo, I don’t necessarily trust the numbers given here in absolute terms. I might be inclined, however, to put more faith in the relative growth/decay. Although even that is odd. If you look at the timeplot in the software popularity article, you will see a massive spike and then equally massive cratering of SPSS. Why might this be? I suppose the economy could be partly to blame (research funds are drying up everywhere and have been for some time), but certainly not entirely. I have no idea what would cause such a sharp rise and then fall except that maybe searching for “SPSS” is hitting a lot of false positives, in addition to some other spectrum of explanations.

SAS has a somewhat similar behavior, although certainly not as pronounced. The SAS one is a little more believable. It is reasonable to think that the crash of the global economy hurt SAS, and that, for SAS Institute, this couldn’t have come at a worse time, since competitors such as R are steadily eating away at the SAS userbase. But I’m still not sure that’s a complete explanation for the behavior seen here either.

What I’m saying is that you should probably take these numbers with a grain of salt.

Finally, there are a few changes here over his previous versions of that graph. If you had seen it before, you would have seen stata in a much stronger position. This is because we had been getting a lot of false positives because the word “stata” is the conditional perfect form of the verb “to be” in Italian. No, seriously. Some other less noticeable changes were made, but all of them are completely transparent in the scraper code posted at the end of this blog. You can see exactly what we did and how we did it, and then angrily post to your newsgroup and/or bbs of choice about it, you giant nerd.

The Data

Ok, so now that boring crap you skipped is out of the way, let’s talk about the data. The most recent data was collected on Monday, April 9th at around 4:00pm EDT. You can grab your very own copy of the data here. I’m not sure why you would want it, but why does anyone want anything. A timeplot of this data is over at the software popularity article. But who cares; timeplots are for boring nerds. The real sweetness is in this sexy thing:

Isn’t that beautiful? Made, of course, with the amazing ggplot2 package for R. I’m not sure what this type of plot is called. It probably has a name, but I’ve always called it a “market share plot”, since that’s basically how they’re used. Anyone who’s ever played Civilization III will be very familiar with these kinds of plots (they also show up a lot in political horse races).

Basically, as the name sort of suggests, the horizontal slices are capturing a sense for how much market share (proportional use) each software has in that time frame. To make your very own sexy market share plot using the example data set linked above (and again here since I know you’re lazy), you could do something like this:

library(ggplot2)
library(reshape2)
library(scales)
Scholar

Now maybe this type of data (for the reasons outlined above in the boring part) isn’t really appropriate for this kind of plot, but at the very least we can appreciate it as a gorgeous plot, even if we don’t entirely trust it.

The Scraper

Ok, so finally, here’s the code for the scraper. Most of you can safely ignore this because, no, I didn’t write it in R—I wrote it in shell. Some people seem to get very angsty when anyone does anything outside of R. R is amazing at what it does. I’m one of R’s biggest fans, but there are some tasks that, in my opinion, are just better suited for the shell. Yes I know I can just use system(), but I don’t want to. Stop complaining so much, voice in my head.

The shebang here is for bash, but it probably will work in less robust shells. If you’re the kind of weirdo who insists on avoiding bash, then this should satisfy you.