DOI: 10.7910/dvn/bypz8n
title: National Health Interview Survey (NHIS)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the national health interview survey (nhis) with r &lt;/h3&gt; the national health interview survey (nhis) is a household survey about health status and utilization. each annual data set can be used to examine the disease burden and access to care that individuals and families are currently experiencing across the country. check out &lt;a href="http://en.wikipedia.org/wiki/National_Health_Interview_Survey"&gt;the wikipedia article&lt;/a&gt; (ohh hayy
i wrote that) for more detail about its current and potential uses. if you're cooking up a health-related analysis that doesn't need medical expenditures or monthly health insurance coverage, look at nhis before the medical expenditure panel survey (it's sample is twice as big).
&lt;a href="http://www.cdc.gov/"&gt;the centers for disease control and prevention (cdc)&lt;/a&gt; has been keeping nhis real since 1957, and the scripts below automate the download, importation, and analysis of every file back to 1963.&lt;br /&gt; &lt;br /&gt; what happened in 1997, you ask? scientists cloned &lt;a href="http://en.wikipedia.org/wiki/Dolly_%28sheep%29"&gt;dolly the sheep&lt;/a&gt;, clinton started his second term, and the national health interview survey underwent its most recent major questionnaire re-design.
here's how all the moving parts work:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;a person-level file (personsx) that merges onto other files using unique household (hhx), family (fmx), and person (fpx) identifiers. [note to data historians: prior to 2004, person number was (px) and unique within each household.] this file includes the complex sample survey variables needed to construct a taylor-series linearization design, and should be used if your analysis doesn't require variables from the sample adult or sample c
hild files. this survey setup generalizes to the noninstitutional, non-active duty military population.
&lt;/li&gt; &lt;li&gt;a family-level file that merges onto other files using unique household (hhx) and family (fmx) identifiers.&lt;/li&gt; &lt;li&gt;a household-level file that merges onto other files using the unique household (hhx) identifier.&lt;/li&gt; &lt;li&gt;a sample adult file that includes questions asked of only one adult within each household (selected at random) - a subset of the main person-level file. hhx, fmx, and fpx identifiers will merge with each of the files above, but since not every adult gets asked thes
e questions, this file contains its own set of weights: wtfa_sa instead of wtfa. you can merge on whatever other variables you need from the three files above, but if your analysis requires any variables from the sample adult questionnaire, you can't use records in the person-level file that aren't also in the sample adult file (a big sample size cut). this survey setup generalizes to the noninstitutional, non-active duty military
&lt;i&gt;adult&lt;/i&gt; population.&lt;/li&gt; &lt;li&gt;a sample child file that includes questions asked of only one child within each household (if available, and also selected at random) - another subset of the main person-level file. same deal as the sample adult description, except use wtfa_sc instead of wtfa oh yeah and this one generalizes to the &lt;i&gt;child&lt;/i&gt; population.&lt;/li&gt; &lt;li&gt;five imputed income files. if you want income and/or poverty variables incorporated into any part of your analysis, you'll need
these puppies. the replication example below uses these, but if that's impenetrable, post in the comments describing where you get stuck.
&lt;/li&gt; &lt;li&gt;some injury stuff and other miscellanea that varies by year. if anyone uses this, please share your experience.&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; if you&lt;span class="Apple-converted-space"&gt; use anything more than the personsx file alone, you'll need to &lt;/span&gt;&lt;a href="http://www.screenr.com/Znd8"&gt;merge&lt;/a&gt; some tables together. make sure you understand the difference between setting the parameter all = TRUE versus all = FALSE -- not everyone in the personsx file has a record in the samadult and sam
child files.&lt;br /&gt; &lt;br /&gt; this new github repository contains four scripts:&lt;br /&gt; &lt;br /&gt; &lt;b&gt;1963-2011 - download all microdata.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;loop through every year and download every file hosted on the cdc's nhis ftp site&lt;/li&gt; &lt;li&gt;import each file into r with &lt;a href="http://cran.r-project.org/web/packages/SAScii/index.html"&gt;SAScii&lt;/a&gt;&lt;/li&gt; &lt;li&gt;save each file as an&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/save.html"&gt;r d
ata file&lt;/a&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;(.rda)&lt;/li&gt; &lt;li&gt;download all the documentation into the year-specific directory&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2011 personsx - analyze.R&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load the &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/base/html/load.html"&gt;r data file&lt;/a&gt; (.rda) created by the download script (above)&lt;/li&gt; &lt;li&gt;set up a taylor-series linearization survey design outlined on &lt;a href="http://www.cdc.gov/nchs/data/nhis/2006var.pdf"&gt;page 6&lt;/a&gt;&lt;a h
ref="ftp://ftp.cdc.gov/pub/health_statistics/nchs/dataset_documentation/nhis/2011/srvydesc.pdf"&gt; of this survey document
&lt;/a&gt;&lt;/li&gt; &lt;li&gt;perform a smattering of analysis examples&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2011 personsx plus samadult with multiple imputation - analyze.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load the personsx and samadult &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/base/html/load.html"&gt;r data files&lt;/a&gt; (.rda) created by the download script (above)&lt;/li&gt; &lt;li&gt;merge the personsx and samadult files, highlighting how to conduct analyses that need both &lt;/li&gt; &lt;li&gt;create tandem survey designs for both personsx-only and merg
ed personsx-samadult files&lt;/li&gt; &lt;li&gt;perform just a touch of analysis examples&lt;/li&gt; &lt;li&gt;load and loop through the five imputed income files, tack them onto the personsx-samadult file&lt;/li&gt; &lt;li&gt;conduct a poverty recode or two&lt;/li&gt; &lt;li&gt;analyze the multiply-imputed survey design object, just like mom used to analyze&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;replicate cdc tecdoc - 2000 multiple imputation.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;download and import the nhis 2000 personsx and imputed income files, using &lt;a href="http://cran.r
-project.org/web/packages/SAScii/index.html"&gt;SAScii&lt;/a&gt; and this &lt;a href="https://github.com/ajdamico/usgsd/blob/master/National%20Health%20Interview%20Survey/INCMIMP2000.sas"&gt;imputed income sas importation script&lt;/a&gt; (no longer hosted on the cdc's nhis ftp site).&lt;/li&gt; &lt;li&gt;loop through each of the five imputed income files, merging each to the personsx file and performing the same set of variable recodes&lt;/li&gt; &lt;li&gt;construct a multiply-imputed survey design object&lt;/li&gt; &lt;li&gt;analyze the multiply-i
mputed survey design object to generate &lt;a href="http://www.cdc.gov/nchs/data/nhis/tecdoc_2010.pdf"&gt;pdf page 60 of this technical 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/National%20Health%20Interview%20Survey"&gt;click here to view these four scripts&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; for more detail about the national health interview survey (nhis), visit: &lt;br /&gt; &lt;ul&gt; &lt;li&gt;the centers for disease control and prevention's &lt;a href="http://www.cdc.gov/nchs/nh
is.htm"&gt;national health interview survey homepage&lt;/a&gt; &lt;/li&gt; &lt;li&gt;the national health interview survey &lt;a href="http://en.wikipedia.org/wiki/National_Health_Interview_Survey"&gt;according to wikipedia&lt;/a&gt;&lt;/li&gt; &lt;li&gt;the minnesota population data center's &lt;a href="http://www.ihis.us/ihis/index.shtml"&gt;harmonized national health interview survey homepage&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; the national health interview survey is the first and only us government survey data set to include any &lt;a href
="http://www.cdc.gov/nchs/data/nhis/2006var.pdf"&gt;r syntax examples (page 6)
&lt;/a&gt;. an inspiration.&lt;br /&gt; &lt;br /&gt; the cdc often includes supplemental survey questions in nhis. &lt;a href="http://www.cdc.gov/nchs/nhis/supplements_cosponsors.htm"&gt;check 'em out&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; unless specified by the question's phrasing, most nhis variables should be treated as point-in-time, as opposed to either &lt;i&gt;annualized&lt;/i&gt; or &lt;i&gt;ever during the year&lt;/i&gt;. this distinction is particularly important for health insurance coverage. think about these three statistics --&lt;br /&gt; &lt;ul&gt; &lt;l
i&gt;the number of americans who won't have health insurance at least once during this year
&lt;/li&gt; &lt;li&gt;the number of americans without health insurance right now&lt;/li&gt; &lt;li&gt;the number of americans who won't ever have health insurance during this year&lt;/li&gt; &lt;/ul&gt; -- the number of americans without health insurance right now is the point-in-time variable, smaller than the &lt;i&gt;at least once&lt;/i&gt; number but larger than the &lt;i&gt;ever&lt;/i&gt; number.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, and sudaan users: why are you still rocking out on that cassette tape after we've designed the ipod?
time to transition to r. :D