1
$\begingroup$

I hope this question is not inconvenient for any of you, so I would appreciate if you do not mark it as not useful.

I want to work with the data of the CPI from the BLS (I am not American, and this is the first time I am using the BLS). I want to ask where I can find the raw data and the relative importance of components. My goal is to build some aggregate categories of my own.

Also, I would like to know if there exists any R script or Stata do file that explains how to build the CPI.

Thank you in advance for your help.

$\endgroup$

2 Answers 2

1
$\begingroup$

The BLS details the construction of the CPI Index in detail here

Moreover, you can find some notes on methodology changes here

You may find the package IndexNumR in R useful for index number calculation, you can find the documentation here

$\endgroup$
1
$\begingroup$

There are multiple different ways of how CPI can be constructed, if you want just some general approaches then some examples include Blair (2013) or Shapiro & Wilcox (1997) and sources cited therein.

Other handbooks than the BLS you do not find useful also have detailed explanations of how they construct CPI. See here for example this practical guide to CPI from UN looks good.

However, I am surprised that you say you found BLS Handbook of Methods not useful. In chapter 17 they describe the way how they estimate CPI in excruciating detail (over more than 100 pages).

I dont think there is any publicly avaiable R scrip or stata do file with calculation of CPI from ground up. I doubt that statistical offices even compute these indices with R or stata. However, R package that you might find useful is blscrapeR - which should allow you to extract CPI even for a subset of data.

$\endgroup$
6
  • $\begingroup$ I guess my question goes more in the sense of how to access and work with the raw data and if there is a document that explains how to use that data to build the CPI. For exameple, I found this: download.bls.gov/pub/time.series/cu/cu.txt and the data files that are in the directory, but I cannot see more details on how one could use the data for analysis. $\endgroup$
    – Alex Ruiz
    Commented Nov 6, 2020 at 17:00
  • $\begingroup$ @AlejandroRuiz I am little bit confused by what exactly you would like to find. The text document you linked does not have everything, but when I look at the handbook I linked in my answer it covers excruciating detail. It even covers how exactly raw data are collected and how exactly the CPI is constructed. The handbook literary goes even into detail on areas where the sampling is done and how pries are recorded/imputed in different sectors. If you are asking for some further analysis once you already have CPI, that of course wont be in the handbook $\endgroup$
    – 1muflon1
    Commented Nov 6, 2020 at 17:06
  • $\begingroup$ - which is just a guide to how data are build and has nothing to say how they should be further analyzed, but the latter depends specifically on your research and if this is what you want then your current Q does not reflect that. $\endgroup$
    – 1muflon1
    Commented Nov 6, 2020 at 17:06
  • $\begingroup$ My main question would be: Where can I find the raw data and the relative weights? My goal is to build some aggregate categories of my own. $\endgroup$
    – Alex Ruiz
    Commented Nov 6, 2020 at 17:22
  • $\begingroup$ @AlejandroRuiz oh well I wish you would say this in your original Q because that is quite a different question. However, the weights are in that handbook chapter 17 that I linked. The weights are in text they won’t be published as separate data. For example at pp 30 you have list of different weights for CPI-U. When it comes to raw data on specific areas that won’t be in the handbook of course, for that I think the R command will be useful as it allows you to scrape the data but to just provide direct link I would have to some further search (it was not clear you want this form the original Q) $\endgroup$
    – 1muflon1
    Commented Nov 6, 2020 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.