# How do I calculate price elasticity of demand using historical price and quantity data?

I work for a company that produces retail items and I am tasked with calculating the price elasticity of demand for a subcategory that shall remain unnamed. I have 5 years of monthly market data that shows market price as well as ounces sold. My independent variables include IV estimated prices, monthly income spent on non-durables (national Fred data), ounces sold of a related subcategory, and 11 dummy variables for the 12 months of seasonality. The model is Log-Log.

My idea was to control for everything that would be a supply side factor and then use the coefficient of price as my demand curve slope. Of course, the demand curve is always changing, but in aggregate I would assume a relatively steady demand curve. It would at least be better than simply calculating dQ/dP. The problem is my coefficient for price is positive. Also, even though the R-Square is around 70% and the F-Stat is significant at the 99%+ level, my individual parameters are mostly not statistically significant.

The problem is, I am looking at monthly data for an entire subcategory. The volume sold and weighted average prices continue to rise and I am not sure how to isolate demand. Any ideas would be greatly appreciated.

Regarding the IV price estimator to remove endogeneity, I ran the stage 1 regression with the cost of raw materials as my X and price as Y. This price estimator has an R-Square of .91. The cost of raw materials has a correlation of .11 versus .32 when run against quantity.

You've fallen into a really common pitfall -- the spurious regression. The parameters you chose to include can't be chosen 'willy nilly' by throwing data into a regress command. Ultimately this can't be answered in so little words, without data, while maintaining accuracy.

That said I can try to answer your question as a reference point. Before even attempting this I couldn't emphasize enough caution. Just remember that a model that's almost correct -- for practical purposes is 100% wrong.

So it seems you've settled on a linear log-log specification. I would do a quick Google Scholar search on papers forecasting consumer demand for a product similar to the one of interest. The functional form along with parameters you choose to include must be derived from theory. You'd be able to just copy their equation and just modify it to your data. Otherwise, you're doing blind statistics. This is the main reason you're getting inconsistent signs.

What you're trying to do is specify a derived demand for the category of goods you're focussing on. Your general model is going to look like this:

$logQ_t = \alpha + \beta_llogP_t + X'_t\gamma + \epsilon$

where: Q sales
P selling point
X vector of factors other than selling price
$\epsilon$ random component in demand

Have you included any economic indicator parameters? This would be things like GDP, income, population growth, unemployment, interest rates... etc. Depending on the good -- for your purpose -- there's usually theory providing necessary parameters regardless of statistical significance. I would do this first. Add some macro indicators and re-check the F-statistic for the model. Your model would then provide not only own price elasticity of the good, but you'd get an income elasticity, as well as cross-price elasticities for competing/complementing goods. If your company has spent money on advertising this would be necessary to include as well. Have you added dummy variables for the 'category' of the good itself? And trend variables? Lags of seasonal effects, their quadratic effects? Interaction effect variables?

Any cursory approach would lead to omitted variable bias over your misspecified parameters. On most circumstances you'll have to verify the multiplier effect isn't changing through time.

Have you checked for normality, autocorrelated errors?

This is as broad and general a reference I can think to give you. The functional specification here might be better calculated through an autoregressive form. But this is beyond the scope I think.

I'm not sure as to your level of econometric/demand analysis so I kept things devoid of much math. I hope this was somewhat helpful. It was great intuition to stop what you're doing when you saw incorrect signs. Keep to that rule of thumb.