# Plot of quantity and price in purchases of the same product - Should it be a power-law distribution?

I work for the Brazilian Government and I realized recently that most of the purchase data I have tested is a power law. I am wondering what does it mean? At first, I thought that the relation between price and volume bought should be similar to a straight line without using the log function. Then, I thought about it and it kind of makes sense to think that I get twice the discount as I increase the volume ten-fold, for instance. However, I am having a hard time actually understanding what this means. Could someone help out?

To make it more clear. One of the data I have is the quantity vs price of diesel purchases made by the Government in 2012. So, for every purchase made by different agencies, I have the price paid per liter and the quantity it bought. When I plot this two in a simple scatterplot, I pretty much get a power-law distribution.

Well, first, there are a few problems with my data, since some quantities are totally wrong (a lot of people buying just 1 liter for as much as thousands of dollars for that single liter!). Besides that, on the other end of the distribution, I have those buying a whole bunch of liters (thousands) and paying 0 for each liter! Exactly, paying ZERO, nothing, nada. So, you can imagine we have some typing issues on the user end when filling out the quantities. One thing they never get wrong is the total price, since they need that to pay the seller.

Anyway, even if I remove these outliers, I still end up with a power-law distribution (at least it seems so). In the end of the day, I was just trying to understand if there is a correlation between quantity bought and price paid. And here goes my question. Should the high volume/low price be represented as a power-law distribution? In other words, if I have a power-law, does it mean that I have a high correlation between price and quantity? If I compute the cor(log(data$$valuePerLiter), log(data$$quantity)), I get something around -.70, which seems to be a decent correlation. However, if I compute the cor(data$$valuePerLiter,data$$quantity) I get a value close to 0. So, do I have a strong correlation between price and quantity or not? Is a power-law distribution expected in this scenario?

• Should this be posted in the econ forum? Too bad you can't cross post. – JenSCDC Sep 7 '14 at 8:02

In order to conclude that some quantity follows a power-law distribution, you need to apply rigorous statistical tests. Visual diagnostics are generally unreliable for this kind of task, and simple curve fitting approaches often give spurious results. There are some freely available packages that can help you make this determination properly, and I'd recommend reading this paper on the methods

A Clauset, CR Shalizi, and MEJ Newman, "Power-law distributions in empirical data." SIAM Review 51(4), 661-703 (2009).

If your data really do end up being plausibly power-law distributed, then it comes time to understand what kind of processes might be generating those patterns. Two good references for understanding those questions are these (both available online; just search for their titles)

MEJ Newman, "Power laws, Pareto distributions and Zipf's law." Contemporary Physics 46, 323–351 (2005).

M Mitzenmacher, "A Brief History of Generative Models for Power Law and Lognormal Distributions. Internet Mathematics 1, 226-251 (2004).

Note that because there are many processes that generate power-law distributions, one generally has to do more work to decide which is the right process for your system.

• "statistical tests" won't tell you something does follow a power law distribution, since there could be distributions different from, but arbitrarily close to a power law. – Glen_b Sep 7 '14 at 9:39
• Welcome back to CV, Aaron! All your posts have been impressive and valuable contributions. I appreciate your sharing your expertise with us and especially admire the thought and care that have gone into your answers. – whuber Sep 7 '14 at 15:19