# Can I simply subtract an index from another?

I am currently using a measure of the price level (CPI) from which I would like to remove the effects of food prices (also an index). Notice that food prices are included in the CPI (so that CPI is the total index).

First, I made sure that both were based in the same way (that is, the base value of 100 is on the same time point). Now, if I simply subtract the food price index from the CPI, I end up with small values hovering around 2, so I am quite sure it is not the way.

I tried the following: CPI+(CPI-food price) and CPI-(CPI-food price) in order to get rid of the food price index. However, I am not sure whether it is the first or the second method since, obviously, both give me a value of 100 on the base date.

My hunch is, it is the CPI-(CPI-food price) but I would like your take on this.

• You cannot obtain CPI_without_food simply by subtracting food CPI from total CPI. CPI is a weighted sum of many components. For example, it is possible that CPI is 5% food CPI + 10% clothes CPI + 15% appartment CPI + 10% transportation CPI + 10% fuel CPI and so on. If you don't know how much of CPI is food, you cannot calculate what you want. (There are some additional details, but I omit them for simplicity.) Nov 4, 2013 at 9:04
• Thank you for this clarification. You are absolutely right. Nov 4, 2013 at 9:27

Picking up on the comment of @user31264, CPI is calculated with a formula like this: \begin{align} CPI_t = \frac{\sum_i w_i p_{it}}{\sum_i w_i p_{it^*}} \end{align} Price of item $i$ at time $t$ is $p_{it}$. Prices in the baseline year are $p_{it^*}$. Each price's weight in the CPI is $w_i$. These weights are determined from a "market basket" which represents an attempt to match the spending habits of a typical US, urban household (assuming you are talking about the CPI-U for the US) --- you can productively think of these weights as representing the quantity of item $i$ bought by an average US household. The weights are not literally these quantities, but it is OK to think about them this way most of the time.

Some of the items (some of the $i$) are food items, and some are not. Let's denote the food items as $i \in F$ and the non-food items as $i \not\in F$. Then CPI-food and CPI ex food look like: \begin{align} CPI_t^F &= \frac{\sum_{i \in F} w_i p_{it}}{\sum_{i \in F} w_i p_{it^*}}\\ &\strut \\ CPI_t^{\tilde{}F} &= \frac{\sum_{i \not\in F} w_i p_{it}}{\sum_{i \not\in F} w_i p_{it^*}}\\ \end{align}

Now, we can do some algebra: \begin{align} CPI_t &= \frac{\sum_i w_i p_{it}}{\sum_i w_i p_{it^*}}\\ \strut \\ &= \frac{\sum_{i \in F} w_i p_{it}+\sum_{i \not\in F} w_i p_{it}} {\sum_iw_ip_{it^*}} \\ \strut\\ &= \frac{\sum_{i \in F} w_i p_{it^*}}{\sum_iw_ip_{it^*}} \frac{\sum_{i \in F} w_i p_{it}}{\sum_{i \in F} w_i p_{it^*}} +\frac{\sum_{i \not\in F} w_i p_{it^*}}{\sum_iw_ip_{it^*}} \frac{\sum_{i \not\in F} w_i p_{it}}{\sum_{i \not\in F} w_i p_{it^*}} \\ \strut\\ &=\frac{\sum_{i \in F} w_i p_{it^*}}{\sum_iw_ip_{it^*}} \cdot CPI_t^F +\frac{\sum_{i \not\in F}w_i p_{it^*}}{\sum_iw_ip_{it^*}}\cdot CPI_t^{\tilde{}F} \\ \strut \\ CPI_t^{\tilde{}F} &= \frac{\sum_iw_ip_{it^*}}{\sum_{i \not\in F}w_i p_{it^*}} \cdot CPI_t -\frac{\sum_{i \in F} w_i p_{it^*}}{\sum_{i \not\in F}w_i p_{it^*}} \cdot CPI_t^F \end{align}

So, to back out CPI ex food from CPI and CPI food, you divide overall CPI by the proportion of spending on non-food in the baseline year (the year the market basket was measured in), then you subtract off the CPI food times the ratio of food to non-food spending in the baseline/market-basket year.

You need to be careful that each of the years of CPI data you use are calculated based on the same market basket. The Bureau of Labor Statistics does occasionally update the market basket. Currently, CPI is based on a 2009/10 market basket. Furthermore, if you use a "chained" index, the market basket is updated every year, so that the method outlined here does not apply.

Finally, a caveat. What the BLS actually does to calculate the CPI is more complicated than what I have laid out above. What I have laid out above is the basic idea, but the implementation details are dizzying. Spend a long time reading the various reports and documentation on the BLS website if you want to actually understand.

• The main difficulty is that the basket proportions are published in a random PDF somewhere in the dark recesses of the website. I seem to recall finding it once and no longer needing it by the time I found it. Or that was a dream and I never actually found it. Jan 4, 2014 at 10:19

What i am suggesting is not the right answer and i agree with the comments that it cannot be calculated. However if you still had to do it, and nothing else is given, then i would suggest that you can fit a regression model with the CPI as the dependent variable and the food price index as the independent variable. if you get a good fit, then you know how to remove the effect of the food price index simply by subtracting the food price index multiplied by the coefficient you get. and once again, this is just an attempt if nothing else is provided and you get a good fit.

• This will not work. CPI is meant to measure overall inflation---the whole idea behind the index is that there is some common factor driving both food and non-food prices. That violates the assumption that the covariance between the right-hand-side variable food CPI and the error term in the regression is zero. What you will end up with is CPI without food CPI and without the part of non-food-CPI which is correlated with food CPI. Is is highly unlikely that this is what OP wants.
– Bill
Nov 4, 2013 at 15:31
• So you mean to say that the CPI just cannot be considered as a time series which contains a component that depends solely on food prices and a component which is independent of it ? This i am not so sure about. My thinking was that it would fail because there would be a lot of variation in the dependence on the food component. but you have given a whole different line of thought, which i will need some more convincing about. Nov 5, 2013 at 15:01

It is not a good idea to mess with the CPI calculations done by the BLS.

If you need to remove the effect food prices, there are several alternative data set options:

• pick the data set with less food and energy
• use the PPI instead where you do have more choices to pick from if you want to exclude food
• email the BLS to tell them what you need and they may better direct you to an appropriate data set and/or sell you the appropriate data set