An explosion erupts from a CSX Corp train derailment in Mount Carbon West Virginia pictured across the Kanawha River in Boomer, West Virginia February 16, 2015. REUTERS/Steve Keenan

The recent explosive train derailment in West Virginia has policymakers considering relative merits of moving oil by pipe or rail, particularly against the backdrop of a national debate over the Keystone XL oil pipeline. The question on everyone's mind: which is safer?

Pipeline supporters say that accidents happen more frequently on the rails. Rail proponents counter that when pipes do fail, they spill a lot more oil. And according to spill data compiled by the Pipeline and Hazardous Materials Safety Administration (part of the DoT), they're both right.

But we're missing a key piece of information here: the total amount of oil transported via rail and pipeline.

In 2013, we moved about 8.3 billion barrels of crude oil via pipeline, according to the Association of Oil Pipelines. By contrast, only about 291 million barrels of oil moved by rail in 2013, according to the Association of American Railroads. In other words, pipeline oil volume was about 29 times greater than rail oil volume in 2013.

So using industry figures from the past several years in conjunction with the federal spill data, we can get a good sense of the rate of accidents and spillage per billion barrels of oil transported. I've charted that below.

It's abundantly clear that the rate of accidents per billion barrels is significantly higher for rail, and it also fluctuates more year to year. Pipelines see a pretty steady 22 or so accidents per billion barrels of oil transported. In recent years, the rate for rail-transported oil is 10 to 20 times higher than that. But the rail accident rate is falling, suggesting that railroads are starting to make the safety investments necessary to deal with the huge increase in oil business the industry has seen since 2010 or so.

The spillage rate figures show that rail typically does better than pipe. In 2012, for instance, railroad operators spilled about 500 barrels of oil for every billion they moved. Pipeline operators, on the other hand, lost about 2,000 barrels per billion.

But look what happened in 2013: the number for rail shot up to 40,000 barrels spilled per billion moved. This was a direct result of two major derailments that year, one in Aliceville Alabama and the other in Casselton North Dakota. The numbers illustrate how volatile these figures can be -- one big spill can completely change the face of an industry's safety record.

Pipeline spills are, on average, larger than railroad spills. But the data above show that rail accidents can be just as disastrous when it comes to the quantity of crude released into the environment. Rail transport is by nature more volatile than pipeline transport. When you have heavy equipment thundering across the landscape at high speed, the potential for a truly explosive disaster is higher than when you have fluid flowing through a metal pipe.

So it's pretty clear here that moving oil by pipe is a less risky proposition than moving it by rail. Both the rate of accidents and the total amount of spillage varies less for pipe transport than for rail transport. To the extent that we can shift some of that transportation burden from rails to pipes, we can drastically lower the odds of spill incidents, and potentially lower the overall volume of oil spilled as well.

Both rail and pipeline industries are investing heavily to improve their safety infrastructure. And it's worth pointing out that despite having a bad year in 2013, more than 99.99% of crude delivered by rail made it to its final destination.

The simple fact is that as we produce more oil and move it from place to place, we're going to see more oil spills. We can take some steps to reduce that risk, but until we're getting a lot more of our energy from less-volatile sources, we can't make that risk disappear.