The Bureau of Labor Statistics is the federal agency of the United States government tasked with fact-finding about labour economics within the U.S.
The data is used as a measure of regional inflation, among other uses.
For a graphic of of how different prices from the consumer database are weighted to construct the Consumer Price Index, see All of Inflation's Little Parts.
But what if you want to know more than average price weights from March 2007 to March 2008?
You'll have to access the data yourself. The following tutorial will tell you how.
Okay. You're convinced. The Bureau of Labor Statistics can help you understand the U.S. economy by getting the facts about price histories in the U.S. market.
In the next couple minutes, you will create a simple visualization for a commodity, and a data file you can use to do your own analysis or make an interactive graphic.
Go to the BLS Database section and pick a database.
Let's get the average price of romaine lettuce for U.S. cities.
In the Average Price Data row, click Multi-Screen Data Search
Choose 0000 U.S. city average, or other region of interest
After selecting the region, click Next form
Pick a food from the table, or search by item name with the first text box in the form. Type lettuce and click Search.
Two results should appear: Lettuce, iceberg and Lettuce, romaine. Pick your favorite salad lettuce.
Click Next form
For reference! Romaine lettuce will produce a code like this:
APU0000FL2101
You might want to save this as part of the CSV filename you create later.
Click Retrive Data
You can inspect the data table now, but it might help to create a graph first...
Click include graphs then the little blue Go button.
You should see a graph like the following following:
Series Id: APU0000FL2101
Area: U.S. city average
Item: Lettuce, romaine, per lb. (453.6 gm)
Click More Formatting Options
Check the All Years button
Change the Output Type to Text, and leave as comma delimited
Click Retrive Data
You'll be returned to a page, which may or may not have a graph. You should see a block of numbers and commas with no spaces, with columns:
Year,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,Annual,
The last few columns may be a bit different.
Copy this entire block of text and save it as a text file, lettuce.csv.
You've just extracted the price history for a commodity out of the Bureau of Labor Statistics database as a graph and data file. Congratulations!
The CSV file is compatible with spreadsheet software like Excel and http://www.libreoffice.org/, which can both produce other types of charts.
To build an interactive graphic for the web, try:
- Create Customized Tables - similar to the above tutorial with pictures.
- Bureau of Labor Statistics FAQ
There are some data files extracted in the above manner sitting in the data folder, as well as graphs. I plan to add starting points for interactive graphics as well to the repository.
- Total CPI for all urban consumers 1947-2912 - CUSR0000SA0