The Consumer Price Index affects the wages of 2 million workers covered by collective bargaining, the payments to 48.4 million people on Social Security, food stamps for 19.8 million people, and the cost of lunches at school for 26.5 million children. It is used to measure inflation.
The US Department of Labor's Bureau of Labor Statistics makes the index, using the average change in prices paid by urban consumers for a fixed set of goods and services. Categories include food and beverages, housing, and clothing.
In this module we explore how to find the Index on the Internet, convert its history to a table in Microsoft Excel®, graph the data, fit an exponential curve to the data, adjust prices for inflation, and calculate the rate of inflation. The methods can be adapted for other spreadsheets -- the figures and tables will show what functions are needed. Knowledge of college algebra and statistics is helpful but not required.
Acknowledgments: The graphic on this page is clip art copied from The Voice of Agriculture Newsroom, Vol. 77, No. 11, 1998. I wish to thank Editor David A. Smith, Ken Steward and other employees of the Bureau of Labor Statistics, and the anonymous referees for helpful suggestions and encouragement in the preparation of this module.
The Consumer Price Index affects the wages of 2 million workers covered by collective bargaining, the payments to 48.4 million people on Social Security, food stamps for 19.8 million people, and the cost of lunches at school for 26.5 million children. It is used to measure inflation.
The US Department of Labor's Bureau of Labor Statistics makes the index, using the average change in prices paid by urban consumers for a fixed set of goods and services. Categories include food and beverages, housing, and clothing.
In this module we explore how to find the Index on the Internet, convert its history to a table in Microsoft Excel®, graph the data, fit an exponential curve to the data, adjust prices for inflation, and calculate the rate of inflation. The methods can be adapted for other spreadsheets -- the figures and tables will show what functions are needed. Knowledge of college algebra and statistics is helpful but not required.
Acknowledgments: The graphic on this page is clip art copied from The Voice of Agriculture Newsroom, Vol. 77, No. 11, 1998. I wish to thank Editor David A. Smith, Ken Steward and other employees of the Bureau of Labor Statistics, and the anonymous referees for helpful suggestions and encouragement in the preparation of this module.
Note: Each link to an external Web site will open a new window. You can return to the module either by closing that window or selecting this one.
Visit the Web site of the Bureau of Labor Statistics. While on that page, carry out the following steps.
b) Or use this method, whether or not you have a Java browser: Select:
Figure 2. Part of Consumer Price Index Table, as downloaded from Bureau of Labor Statistics. Accessed March 3, 2003. |
![]() |
Note: This method of getting the table into Excel may not work with Macintosh computers. In that case, click here.
The Bureau changes its Web site occasionally. If you have trouble getting the information, write or call the Bureau. On the home page, under “People are asking . . .” click “Send us your question” to e-mail a question to the Bureau. Also on the home page is a list of information offices for the bureau.
The resulting table should resemble the one shown (in part) in Figure 3.
Figure 3. Part of Consumer Price Index Table with new column B inserted |
![]() |
In this section we add a "best-fitting" exponential curve to the data plot and interpret this exponential trend curve.
For CPI data from 1913 through 2002, the equation of the fitted curve is . Your equation may be slightly different if your table includes different data. Here, x is the number of years since 1913, and y is the value of the Consumer Price Index. The statistical term R 2 is the coefficient of determination, which in this case is 0.9101. This statistic varies between 0 and 1 and measures how well a trend curve explains the data. An R 2 greater than 0.9 suggests a good fit, but the picture shows some obvious problems with the fit. In the next two paragraphs -- for which a little background in statistics is helpful -- I explain why the high R 2 does not necessarily mean a good fit.
As we will see shortly, the exponential fit is based on fitting a regression line to something. In regression analysis we fit a straight line to points
. (The variables x and y here are "generic" -- they are not necessarily our time and CPI variables.) For each value of the independent variable x and the dependent variable y, we may write
, where m and b are the regression coefficients, and
(called the residual) is the difference between the actual and fitted values of y. The assumptions of regression analysis are that the values of
for all values of x are independent and normally distributed with mean 0 and variance the same for every x. If these assumptions are correct, we should see the data points cluster about the regression line, bouncing erratically above and below it.
For fitting an exponential curve to data, we make corresponding assumptions about the logarithm of y. We fit a regression line to the points , which should then cluster and bounce about the line, if our assumptions are correct. Then we expect the points
to cluster and bounce about the corresponding exponential curve. But the CPI points are above the exponential curve until year 18 (1931) and again after year 66 (1979). In between, they are below the curve. This pattern displays a strong dependence of values of
on nearby values, not the random fluctuations that we expect. It follows that the assumptions for a regression fit are not satisfied by the CPI data.
Nevertheless, the exponential trend curve does give us a general picture of the growth in CPI over time, and that's the significance of the relatively large R 2. In the next two sections, we will see some algebraic reasons for not placing too much confidence in the trend curve -- in particular, we will see that there is no way to predict inflation accurately. An economist (Haimowitz) notes that governments often manipulate prices. This is certainly the case in controlled economies, but it happens in the U.S. too. This is one of the economic reasons why inflation has often not been exponential. However, learning to fit a curve to data is useful, if only for discerning general trends, and of course you can apply this skill in other situations as well.
In the preceding section we observed that the exponential trend curve is determined by doing a linear regression with data points of the form . We can, of course, do that linear regression directly by taking natural logarithms of the y data. Furthermore, it is often more revealing to work with the logarithm of data than the data itself. The CPI rose from 2.3 in 1913 to 179.9 in 2002, a change of two orders of magnitude. The standard xy-graph does not do justice to the details of change over such a large range. But if we work with logarithms of the CPI, our graph can show details of the entire history. Here is the way to calculate natural logarithms of a data column in Excel:
To graph the logarithmic data, follow these steps:
In the preceding section we saw that the exponential trend curve has the formula . If we take the natural log of the right-hand side of this formula, we find that
.
This last expression is the formula for the regression line in Figure 10 -- which confirms that the exponential trend curve is actually derived from the regression line.
Another way to see a logarithmic plot of the data is to use a logarithmic scale on the vertical axis. To do so, go to the original graph in your worksheet (see Figure 6 or Figure 7). Double-click the vertical axis. Choose Scale and Logarithmic scale
Any of several statistics can be presented in the media as the "Official CPI." One is the index itself (for all urban consumers), as we have used it in this module. Another is the 12-month percent change, such as from August 2001 to August 2002. The annual inflation rate for a given year (say, 1914) is the percent change from the previous year (1913 in this example). Here is the way to calculate the annual inflation rate for 1914:
.
So the inflation rate for 1914 was about 1.0%.
Excel can calculate inflation rates for every year of the CPI except 1913 (when there was no previous year tabulated). In cell E1 of your most recent table (see Figure 9), write Inflation Rate %. In Cell E3 write
The result, approximately 1.0, appears in cell E3. Copy the formula down column E. The result should look like Figure 11. (For tips on making the table more legible, see “Improve the Table.”)
Figure 11. Adding an inflation rate column to the table
To graph inflation rates, use Columns B and E and continue as on Page 4. (Add a linear trend line if you like.) The result looks like Figure 12, with many fluctuations and a range from -10.5% (1921) to 18.0% (1918).
Figure 12. Annual inflation rates since 1913
You can also get inflation rates and a graph directly from the BLS Web site. Follow the same steps you did in Section 1:
The press often mentions “average inflation rate,” say, for the period 1951 (CPI 26.0) to 2001 (CPI 177.1). This number is not the average of the inflation rates over those years. Instead, it is a percent such that, if the CPI grew at that annual rate, compounded, from 1951 (26.0) to 2001, the same result of 177.1 would occur in 2001. The actual inflation rate fluctuated greatly, as you saw in Figure 12. But suppose it had been 4% (0.04 as a decimal) every year. Then the CPI would have grown by a factor of 1.04 each year, starting at 26.0. After 50 years -- 1951 to 2001 -- the CPI would be . Since 185 is larger than 177.1, 4% is a little too big. Let's calculate the correct average rate.
Call the decimal rate x. Since the CPI went from 26.0 to 177.1 over a period of 50 years, we know that . Thus,
.
As is often the case with averages, the actual rates in this 50-year period do not cluster around the average. They vary from –0.4% (1955) to 13.5% (1980). See “Inflation and Deflation” for more information about positive and negative growth rates in the CPI.
The Consumer Price Index is often used to adjust data for inflation. For example, say you had a monthly salary in 1991 of $5000. What was the equivalent salary in 2001? The CPI in 1991 was 136.2, and in 2001 it was 177.1. The ratio of these two numbers should match the ratio of the salaries in order to keep the buying power the same. Thus, we need to find the salary x such that
.
Your answer should be somewhat more than $6500. If you earn less than that, you are not keeping up with inflation -- your income on paper may look like it has increased by, say, 25%, but you cannot buy the goods and services you bought before. You need an increase of about 30% to keep up with inflation for this period.
The same information about equivalent salaries can be calculated on the Web site of the Bureau of Labor Statistics. Go to Inflation & Consumer Spending and Inflation Calculator.
Inflation rates have been moderate in the past decade, always positive, but never reaching 4%, and generally under 3%. However, prices for some categories have behaved differently from the general CPI. Figures 13 through 16 were all made on the Web site of the Bureau of Labor Statistics. Each is for 12-month percent change in prices for every month from January 1993 to January 2003. In order, these graphs represent
Try getting these graphs and their data tables yourself. As before, go to www.bls.gov, Get Detailed Statistics, CPI—All Urban Consumers (Current Series), and Create Customized tables (One Screen). Then do these steps:
Now go back to Step 2 and click on Gas (piped) and electricity, then Add to Your Selection. Similarly select Apparel and College tuition and fees. Click Retrieve Data.
Go to More Formatting Options. Use the default time range, which yields the 10 most recent years. (For the current year, the most recent month is used.) Use the default All Time Periods. Uncheck Original Data Value. Check 12 Months Percent Change, include graphs, and Retrieve Data.
AmosWEB LLC. AmosWEB GLOSS*arama. http://www.amosweb.com/gls/. Accessed March 16, 2003. See in particular the entries “CPI,” “Inflation,” “Deflation,” “Depression,” and “Recession.” Use the Quick Search box as needed.
Haimowitz, J. Assistant Professor of Economics, Avila University, Kansas City, MO. Personal interview, August 29, 2002.
Lynch, P. J., and S. Horton. Web Style Guide, 2002. http://www.webstyleguide.com/. Accessed March 22, 2003. See in particular the section “Typefaces.”
Rossman, A. J. "Integrating Data Analysis and Precalculus," Bridges: The Newsletter for the Workshop Calculus Project, Spring 2003, Dickinson College, Carlisle, PA.
Tufte, E. The visual display of quantitative information. Cheshire, CT.: Graphics Press, 1983. This book has guidelines for legible tables and graphs.
Simpson, J. A., and E.S.C. Weiner, Eds. The Oxford English Dictionary. Oxford: Clarendon Press, 1989.
Economics. Danbury, CT.: Grolier Foundation, 2000. This multi-volume work is an encyclopedia of economics with lots of striking graphics. Volume 1, Money, banking, and finance has an article “Inflation and deflation,” pp. 86-87, with a graph of inflation rates for the CPI, energy, new cars, and apparel, all on the same grid. Volume 5, Economic theory, has an article “Consumer price index (CPI),” p. 17. The article “Fiscal policy,” p. 50, states that price stability, meaning inflation rates at most 2%, is a goal of fiscal policy, .
Henderson, D. R., Ed. The concise encyclopedia of economics. http://www.econlib.org/. Accessed March 16, 2003. This is part of the Library of Economics and Liberty, published by the Liberty Fund, Inc. See in particular the article “Inflation” by David Ranson, and search for other economic terms.
Johnson, P. M. A glossary of political economic terms. http://www.auburn.edu/~johnspm/gloss/. Accessed March 16, 2003. See the articles “Deflation,” “Depression,” and “Inflation.”