Giter Club home page Giter Club logo

labor-statistics's Introduction

What can I use this data for?

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.

Getting data on inflation

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.

Start your search

In the Average Price Data row, click Multi-Screen Data Search

Pick a region

Choose 0000 U.S. city average, or other region of interest

After selecting the region, click Next form

Select a commodity

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

Save your search

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

Examine the data table

You can inspect the data table now, but it might help to create a graph first...

Create a graph

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)

lettuce graph

Export a CSV

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!

Visualize the data

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:

Tutorials

Files in the repository

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

labor-statistics's People

Contributors

syntagmatic avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

enjalot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.