What Really Happened to Nigeria’s Economy?

You may have heard the news that the size Nigeria’s economy now stands at nearly $500 billion. Taken at face value (as many commenters have seemed all to happy to do) this means that the West African state “overtook” South Africa’s economy, which was roughly $384 billion in 2012. Nigeria’s reported GDP for that year was $262 billion, meaning it roughly doubled in a year.

How did this “growth” happen? As Bloomberg reported:

On paper, the size of the economy expanded by more than three-quarters to an estimated 80 trillion naira ($488 billion) for 2013, Yemi Kale, head of the National Bureau of Statistics, said at a news conference yesterday to release the data in the capital, Abuja….

The NBS recalculated the value of GDP based on production patterns in 2010, increasing the number of industries it measures to 46 from 33 and giving greater weighting to sectors such as telecommunications and financial services.

The actual change appears to be due almost entirely to Nigeria including figures in GDP calculation that had been excluded previously. There is nothing wrong with this, per se, but it makes comparisons completely unrealistic. This would be like measuring your height in bare feet for years, then doing it while wearing platform shoes. Your reported height would look quite different, without any real growth taking place. Similar complications arise when comparing Nigeria’s new figures to other countries’, when the others have not changed their methodology.

Nigeria’s recalculation adds another layer of complexity to the problems plaguing African development statistics. Lack of transparency (not to mention accuracy) in reporting economic activity makes decisions about foreign aid and favorable loans more difficult. For more information on these problems, see this post discussing Morten Jerven’s book Poor NumbersIf you would like to know more about GDP and other economic summaries, and how they shape our world, I would recommend Macroeconomic Patterns and Stories (somewhat technical), The Leading Indicators, and GDP: A Brief but Affectionate History.

Two Great Talks on Government and Technology

If you are getting ready to travel next week, you might want to have a couple of good talks/podcasts handy for the trip. Here are two that I enjoyed, on the topic of government and technology.

The first is about how technology can help governments. Ben Orenstein of “Giant Robots Smashing Into Other Giant Robots” discusses Code for America with Catherine Bracy. Catherine recounts some ups and downs of CfA’s partnerships with cities throughout America and internationally. CfA fellows commit a year to help local governments with challenges amenable to technology. One great example that the podcast discusses is a tool for parents in Boston to see which schools they could send their kids to when the city switched from location-based school assignment to allowing students to attend schools throughout the city. (Incidentally, the school matching algorithm that Boston used was designed by some professors in economics at Duke, who drew on work for which Roth and Shapley won the Nobel Prize.)

The second talk offers another point of view on techno-politics: when government abuses technology. Steve Klabnik‘s “No Secrets Allowed” talk from Golden Gate Ruby Conference discusses recent revelations regarding the NSA and privacy. In particular he explains why “I have nothing to hide” is not an appropriate response. The talk is not entirely hopeless, and includes recommendations such as using Tor. The Ruby Rogues also had a roundtable discussing Klabnik’s presentation, which you can find here.

Other recommendations are welcome.

This is Your Brain on Hunger

hungerIn his book Thinking Fast and SlowDaniel Kahneman describes the brain as made up of two systems. System 1 is fast, emotional, and almost automatic–I think of this as “intuition.” System 2 controls more logical, deliberate processes. There are many factors that can influence which system you use to make a decision (anchoring, availability, substitution, loss aversion, framing, etc.) and Kahneman’s book discusses these. But other environmental factors can influence which system takes over. This post discusses how hunger shifts the balance from System 2 to System 1.

First up is a study on Israeli judges’ parole decisions broken up by time of day by Shai DanzigeraJonathan Levavb, and Liora Avnaim-Pessoa (edited for PNAS  by Kahneman). Here’s the abstract:

Are judicial rulings based solely on laws and facts? Legal formalism holds that judges apply legal reasons to the facts of a case in a rational, mechanical, and deliberative manner. In contrast, legal realists argue that the rational application of legal reasons does not sufficiently explain the decisions of judges and that psychological, political, and social factors influence judicial rulings. We test the common caricature of realism that justice is “what the judge ate for breakfast” in sequential parole decisions made by experienced judges. We record the judges’ two daily food breaks, which result in segmenting the deliberations of the day into three distinct “decision sessions.” We find that the percentage of favorable rulings drops gradually from ≈65% to nearly zero within each decision session and returns abruptly to ≈65% after a break. Our findings suggest that judicial rulings can be swayed by extraneous variables that should have no bearing on legal decisions.

The Economist summarized the paper and produced a graphic with the main takeaway:

israeli-parole-board

The second paper, by Ilona Grunwald-Kadow and coauthors, analyzes the neural behavior of fruit flies when deprived of food (via @tylercowen and @IFLscience). Their results are explained in this press release from the Max Planck Institute:

The results show that the innate flight response to carbon dioxide in fruit flies is controlled by two parallel neural circuits, depending on how satiated the animals are. “If the fly is hungry, it will no longer rely on the ‘direct line’ but will use brain centres to gauge internal and external signals and reach a balanced decision,” explains Grunwald-Kadow. “It is fascinating to see the extent to which metabolic processes and hunger affect the processing systems in the brain,” she adds.

Remember this next time you’re trying to decide between working through lunch or grabbing a bite to eat. Do your body and your neighbors a favor by taking a break.

See also: 

Trade Secrets of Methodologists: A Bibliography

sciencemethWe all know what the scientific method looks like in idealized form. But the first dirty secret is that you don’t actually write a paper that way. In fact, many papers are written almost in reverse, starting with the findings and working backward. Over the weekend @Worse_Reviewer shared some papers that help to convey these secrets and make grad students aware of the tacit knowledge already put to good use by their more senior colleagues. I have obtained ungated links to the papers (or similar versions) wherever available, along with two additional articles via Mike Ward.

Recommended Packages for R 3.x

sandwichWith the recent release of R 3.0 (OS X) and 3.1 (Windows), I found myself in need of a whole host of packages for data analysis. Rather than discover each one I needed in the middle of doing real work, I thought it would be helpful to have a script with a list of essentials to speed up the process. This became even more essential when I also had to install R on a couple of machines in our department’s new offices.

Thankfully my colleague Shahryar Minhas had a similar idea and had already started a script, which I adapted and share here with his permission. The script is also on Github so if you have additions that you find essential on a new R install feel free to recommend them.

PACKAGES = c("Amelia",
	"apsrtable", 
	"arm",
	"car", 
	"countrycode", 
	"cshapes",
	"doBy",
	"filehash", 
	"foreign", 
	"gdata",
	"ggplot2",
	"gridExtra",
	"gtools",
	"Hmisc", 
	"lme4", 
	"lmer",
	"lmtest",
	"maptools",
	"MASS", 
	"Matrix",
	"mice", 
	"mvtnorm",
	"plm", 
	"plyr",
	"pscl",
	"qcc",
	"RColorBrewer", 
	"reshape", 
	"sandwich", 
	"sbgcop", 
	"scales", 
	"sp",
	"xlsx", 
	"xtable") 
install.packages(PACKAGES)
install.packages('tikzDevice', repos='http://r-forge.r-project.org')

Project Design as Reproducibility Aid

From the Political Science Replication blog:

When reproducing pubished work, I’m often annoyed that methods and models are not described in detail. Even if it’s my own project, I sometimes struggle to reconstruct everything after I took a longer break from a project. An article by post-docs Rich FitzJohn and Daniel Falster shows how to set up a project structure that makes your work reproducible.

To get that “mix” into a reproducible format, post-docs Rich FitzJohn and Daniel Falster from Macquarie University in Australia suggest to use the same template for all projects. Their goal is to ensure integrity of their data, portability of the project, and to make it easier to reproduce your own work later. This can work in R, but in any other software as well.

Here’s their gist. My post from late last year suggests a similar structure. PSR and I were both informed about ProjectTemplate based on these posts–check it out here.

Micro-Institutions Everywhere: Defining Death

From the BBC:

In the majority of cases in hospitals, people are pronounced dead only after doctors have examined their heart, lungs and responsiveness, determining there are no longer any heart and breath sounds and no obvious reaction to the outside world….

Many institutions in the US and Australia have adopted two minutes as the minimum observation period, while the UK and Canada recommend five minutes. Germany currently has no guidelines and Italy proposes that physicians wait 20 minutes before declaring death, particularly when organ donation is being considered….

But the criteria used to establish brain death have slight variations across the globe.

In Canada, for example, one doctor is needed to diagnose brain death; in the UK, two doctors are recommended; and in Spain three doctors are required. The number of neurological tests that have to be performed vary too, as does the time the body is observed before death is declared.

George Box, the Accidental Statistician

GeorgeEPBoxGeorge Box, renowned statistician, passed away on April 10 of this year at the age of 93. As the title of his recently released memoir suggests, he stumbled into the career that made him famous. During the Second World War, he was assigned to the Chemical Defence Experimental Station, located at Porten Down. From there, as he recounts,

[M]y job was to make biochemical determinations in experiments on small animals. The results I was getting were very variable, and I told Cullumbine that what we needed was a statistician to analyze our data. He said, “Yes, but we can’t get one. What do you know about it?” I told him I had once tried to read a book about it by someone called R.A. Fisher, but I hadn’t understood it. He said, “Well you read the book so you’d better do it.” So I said, “Yes Sir.” (Kindle Locations 750-754).

I found this book useful because so many biographies are written as if the protagonist had his or her life all planned out from the beginning. Autobiographies are a bit more honest on this front, but none as much as Box’s.

This is particularly helpful for grad students, who tend to get advice from a very biased sample: successful academics. From their accounts we can estimate the probability that someone successful took a certain course of action. But without information on those who do not become academics, it’s impossible to obtain the probability of success when adopting that same strategy. Box’s memoir alone can’t entirely undo this, of course, but he does relate stories of many of his grad students who chose positions in industry.

Here are some quotations from it that I enjoyed:

  • “A serious mistake has been made in classifying statistics as part of the mathematical sciences. Rather it should be regarded as a catalyst to scientific method itself.” (Kindle Locations 545-546).
  • “I forget whom I lied to (I expect it was the Army— they were used to it), but I did get my discharge.” (Kindle Locations 930-931).
  • “Likelihood methods are like a very intelligent but nondiscriminating child.” (Kindle Location 2024).
  • “None of this is a hanging matter.” (Kindle Location 2029).
  • “Originality and wit are very close.” (Kindle Location 2340).

The main weakness of the book is its meandering style. Box often goes from anecdote to anecdote in a train of thought style where the logic of transition is unclear to the reader. This becomes less irritating by the second half of the book, either because it received better editing or because I grew used to the style.

Overall, I recommend the book to several audiences: grad students in any quantitative field, practicing statisticians, and those who would like to know more about the personal life of this influential figure.

Statistics as Principled Argument

correlationThat’s the title of a book I recently came across by the late Robert P. Abelson. The thesis of the book is that statistics is a tool for organizing an argument. Abelson’s focus is his own discipline of psychology but many of his points apply to social science more broadly.

Throughout the book Abelson accumulates a list of his “laws”:

  1. Chance is lumpy.
  2. Overconfidence abhors uncertainty.
  3. Never flout a convention just once.
  4. Don’t talk Greek if you don’t know the English translation.
  5. If you have nothing to say, don’t say anything.
  6. There is no free hunch.
  7. You can’t see the dust if you don’t move the couch.
  8. Criticism is the mother of methodology.

My main gripe with the book is how much of it hinders on frequentist hypothesis testing. For example, I don’t consider the difference between a p-value of .05 and one of .07 to be a “principled argument.” Abelson does give some attention to Bayesian methods, but a book developing the idea of statistics as rhetoric from a Bayesian point of view would be more coherent.  Perhaps we will see something along these lines from Andrew Gelman’s work on ethical statistics.

Risk, Overreaction, and Control

11-M_El_How many people died because of the September 11 attacks? The answer depends on what you are trying to measure. The official estimate is around 3,000 deaths as a direct result of hijacked aircraft and at the World Trade Center, Pentagon, and in Pennsylvania. Those attacks were tragic, but the effect was compounded by overreaction to terrorism. Specifically, enough Americans substituted driving for flying in the remaining months of 2001 to cause 350 additional deaths from accidents.

David Myers was the first to raise this possibility in a December, 2001, essay. In 2004, Gerd Gigerenzer collected data and estimated the 350 deaths figure, resulting from what he called “dread risk”:

People tend to fear dread risks, that is, low-probability, high-consequence events, such as the terrorist attack on September 11, 2001. If Americans avoided the dread risk of flying after the attack and instead drove some of the unflown miles, one would expect an increase in traffic fatalities. This hypothesis was tested by analyzing data from the U.S. Department of Transportation for the 3 months following September 11. The analysis suggests that the number of Americans who lost their lives on the road by avoiding the risk of flying was higher than the total number of passengers killed on the four fatal flights. I conclude that informing the public about psychological research concerning dread risks could possibly save lives.

Does the same effect carry over to other countries and attacks? Alejandro López-Rousseau looked at how Spaniards responded to the March 11, 2004, train bombings in Madrid. He found that activity across all forms of transportation decreased–travelers did not substitute driving for riding the train.

What could explain these differences? One could be that Americans are less willing to forego travel than Spaniards. Perhaps more travel is for business reasons and cannot be delayed. Another possibility is that Spanish citizens are more accustomed to terrorist attacks and understand that substituting driving is more risky than continuing to take the train. There are many other differences that we have not considered here–the magnitude of the two attacks, feelings of being “in control” while driving, varying cultural attitudes.

This post is simply meant to make three points. First, reactions to terrorism can cause additional deaths if relative risks are not taken into account. Cultures also respond to terrorism in different ways, perhaps depending on their previous exposure to violent extremism. Finally, the task of explaining differences is far more difficult than establishing patterns of facts.

(For more on the final point check out Explaining Social Behavior: More Nuts and Bolts for the Social Sciences, which motivated this post.)