analyze the pesquisa nacional por amostra de domicilios continua (pnadc) with r

June 2, 2015

(This article was first published on asdfree by anthony damico, and kindly contributed to R-bloggers)

the next generation in brazilian employment statistics has arrived.  the pesquisa nacional por amostra de domicilios continua (pnadc) permits economists and social scientists of every stripe to examine employment patterns and trends for all twenty-seven states in the nation.  the brazilian government’s institute of geography and statistics (ibge) intends to replace the pesquisa mensal do emprego (pme) with this new quarterly survey, owing to pme’s coverage of only six metropolitan regions.  this continuous household survey should be viewed as a towering achievement for the dedicated civil servants at ibge: this is a nationally- and state-representative recurring labor survey that rivals the united states’ current population survey and will likely grow into ibge’s flagship product in the next few years. every quarter, they interview brazilians from more than 200,000 households across 3,500 municipalities.  the technical staff over in rio de janeiro (call them ibgeanos) fought hard to make this microdata, so you’d better enjoy it.  this new github repository contains four scripts:

download all microdata.R

  • download each monthly zipped file, plus documentation
  • import each individual microdata table directly into r, short and sweet
  • store quick-to-load copies of each microdata table for easy access later
analysis examples.R

  • load a single quarter of data into working memory
  • construct the complex sample survey object, forgoing the complex survey design*
  • run example analyses that calculate perfect means, medians, quantiles, totals, even ratios
unemployment rate.R

unemployment plot.R

  • load the three most recent quarters of microdata
  • construct the complex sample survey object, forgoing the complex survey design*
  • construct plots of national, regional, and state unemployment rates

click here to view these four scripts

for more detail about the pesquisa nacional por amostra de domicilios continua, visit:


* still a new product, the methodologists at ibge have not yet released the sampling and post-stratification information necessary to construct proper confidence intervals, standard errors, and coefficients of variation.  that’s why each of the currently-released scripts include a warning that the variance calculation is not yet finalized.  the point estimates, however, are correct.  this post will be updated once ibge releases the sample design information necessary to calculate the variance properly.

confidential to sas, spss, stata, sudaan users: cada vez que voce baixar r, um anjo obtem suas asas. 😀

To leave a comment for the author, please follow the link and comment on their blog: asdfree by anthony damico. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)