DOI: 10.7910/dvn/ak4fdd
title: Current Population Survey (CPS)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the current population survey (cps) annual social and economic supplement (asec) with r &lt;/h3&gt; the annual march cps-asec has been supplying the statistics for the census bureau's &lt;a href="http://www.census.gov/prod/2012pubs/p60-243.pdf"&gt;report on income, poverty, and health insurance coverage&lt;/a&gt; since 1948. wow. &lt;a href="http://www.census.gov/"&gt;the us census bureau&lt;/a&gt; and &lt;a href="http://www.bls.gov/"&gt;the bureau of labor statistics (
bls)&lt;/a&gt; tag-team on this one. until &lt;a href="http://www.census.gov/acs/www/"&gt;the american community survey (acs)&lt;/a&gt; hit the scene in the early aughts (2000s), the current population survey had the largest sample size of all the annual general demographic data sets outside of the decennial census - about two hundred thousand respondents. this provides enough sample to conduct state- and a few large metro area-level analyses. your sample size will vanish if you start investigating subgroups b
y state - consider pooling multiple years. county-level is a no-no.
&lt;br /&gt; &lt;br /&gt; despite the american community survey's larger size, the cps-asec contains many more variables related to employment, sources of income, and insurance - and can be &lt;a href="http://data.bls.gov/timeseries/LNU04000000?years_option=all_years&amp;periods_option=specific_periods&amp;periods=Annual+Data"&gt;trended back to harry truman's presidency&lt;/a&gt;. aside from questions specifically asked about an annual experience (like income), many of the questions in this march data set should be t
reated as point-in-time statistics. cps-asec generalizes to the united states non-institutional, non-active duty military population.
&lt;br /&gt; &lt;br /&gt; &lt;a href="http://www.nber.org/"&gt;the national bureau of economic research (nber)&lt;/a&gt; provides &lt;a href="http://data.nber.org/data/cps_progs.html"&gt;sas, spss, and stata importation scripts&lt;/a&gt; to create a rectangular file (rectangular data means only person-level records; household- and family-level information gets attached to each person). to import these files into r, &lt;a href="https://github.com/ajdamico/SAScii/blob/master/R/parse.SAScii.R"&gt;the parse.SAScii function&lt;/a&gt; uses nber's
sas code to determine how to import the fixed-width file, then &lt;a href="http://cran.r-project.org/web/packages/RSQLite/index.html"&gt;RSQLite&lt;/a&gt; to put everything into a schnazzy database. you can try reading through &lt;a href="http://data.nber.org/data/progs/cps/cpsmar12.sas"&gt;the nber march 2012 sas importation code&lt;/a&gt; yourself, but it's a bit of a proc freak show. this new github repository contains three scripts:&lt;br /&gt; &lt;br /&gt; &lt;b&gt;2005-2012 asec - download all microdata.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;down
load the fixed-width file containing household, family, and person records
&lt;/li&gt; &lt;li&gt;import by separating this file into three tables, then merge 'em together at the person-level&lt;/li&gt; &lt;li&gt;download the fixed-width file containing the person-level replicate weights&lt;/li&gt; &lt;li&gt;merge the rectangular person-level file with the replicate weights, then store it in a sql database&lt;/li&gt; &lt;li&gt;create a new variable - one - in the data table&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2012 asec - analysis examples.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;connect to the sql database created by the 'download all microdata' progr
am&lt;/li&gt; &lt;li&gt;create the complex sample survey object, using the replicate weights&lt;/li&gt; &lt;li&gt;perform a boatload of analysis examples&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;replicate census estimates - 2011.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;connect to the sql database created by the 'download all microdata' program&lt;/li&gt; &lt;li&gt;create the complex sample survey object, using the replicate weights&lt;/li&gt; &lt;li&gt;match the sas output shown in the png file below&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2011 asec replicate weight sas output.png&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;
statistic and standard error generated from the replicate-weighted example sas script contained in this census-provided
&lt;a href="http://smpbff2.dsd.census.gov/pub/cps/march/Use_of_the_Public_Use_Replicate_Weight_File_final_PR_2010.doc"&gt;person replicate weights usage instructions document&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; &lt;a href="https://github.com/ajdamico/usgsd/tree/master/Current%20Population%20Survey"&gt;click here to view these three scripts&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; for more detail about the current population survey - annual social and economic supplement (cps-asec), visit:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www
.census.gov/cps/"&gt;the census bureau's current population survey page
&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.bls.gov/cps/"&gt;the bureau of labor statistics' current population survey page&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Current_Population_Survey"&gt;the current population survey's wikipedia article&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; interviews are conducted in march about experiences during the previous year. the file labeled 2012 includes information (income, work experience, health insurance) pertaining to 2011. when you use the current populat
ion survey to talk about america, subract a year from the data file name.
&lt;br /&gt; &lt;br /&gt; as of the 2010 file (the interview focusing on america during 2009), the cps-asec contains exciting new medical out-of-pocket spending variables most useful for &lt;a href="https://www.census.gov/hhes/povmeas/methodology/supplemental/research.html"&gt;supplemental (medical spending-adjusted) poverty research&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, sudaan users: why are you still rubbing two sticks together after we've invented the butane lighter? time to transition to
r. :D