DOI: 10.7910/dvn/zignul
title: National Survey on Drug Use and Health (NSDUH)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the national survey on drug use and health (nsduh) with r &lt;/h3&gt; the national survey on drug use and health (nsduh) monitors illicit drug, alcohol, and tobacco use with more detail than any other survey out there. if you wanna know the average age at first chewing tobacco dip, the prevalence of needle-sharing, the family structure of households with someone abusing pain relievers, even the health insurance coverage of peyote users, you
are in the right place. the &lt;a href="http://www.samhsa.gov/"&gt;substance abuse and mental health services administration (samhsa)&lt;/a&gt; contracts with the north carolinians over at &lt;a href="http://www.rti.org/"&gt;research triangle institute&lt;/a&gt; to run the survey, but the university of michigan's &lt;a href="http://www.icpsr.umich.edu/icpsrweb/SAMHDA/"&gt;substance abuse and mental health data archive (samhda)&lt;/a&gt; holds the keys to this data castle.&lt;br /&gt; &lt;br /&gt; nsduh in &lt;a href="http://oas.samhsa.gov/nsduh
/2k10MRB/2k10Q.pdf"&gt;its current form&lt;/a&gt; only goes back about a decade, when samhsa &lt;a href="http://oas.samhsa.gov/redesigningNHSDA.pdf"&gt;re-designed the methodology&lt;/a&gt; and started paying respondents thirty bucks a pop. before that, look for its predecessor - &lt;a href="http://www.icpsr.umich.edu/icpsrweb/SAMHDA/studies/3580"&gt;the national household survey on drug abuse (nhsda)&lt;/a&gt; - with public use files available back to 1979 (included in these scripts). be sure to read those changes in methodo
logy carefully before you start trying to trend smokers' &lt;a href="http://en.wikipedia.org/wiki/Virginia_Slims"&gt;virginia slims&lt;/a&gt; brand loyalty back to 1999.&lt;br /&gt; &lt;br /&gt; although (to my knowledge) only the &lt;a href="http://usgsd.blogspot.com/search/label/national%20health%20interview%20survey%20%28nhis%29"&gt;national health interview survey&lt;/a&gt; contains r syntax examples in its documentation, the friendly folks at samhsa have shown promise. since their &lt;a href="http://oas.samhsa.gov/NSDUH/2k10NSD
UH/tabs/Sect1peTabs19to23.pdf"&gt;published data tables&lt;/a&gt; were run on a restricted-access data set, i requested that they run the same sudaan analysis code on the public use files to confirm that this new r syntax does what it should. &lt;a href="https://github.com/ajdamico/usgsd/blob/master/National%20Survey%20on%20Drug%20Use%20and%20Health/NSDUH%20PUF_Table_1.19B_D%20from%20SAMHSA.pdf?raw=true"&gt;they delivered&lt;/a&gt;, &lt;a href="https://github.com/ajdamico/usgsd/blob/master/National%20Survey%20on%20Dru
g%20Use%20and%20Health/replicate%20samhsa%20puf.R"&gt;i matched&lt;/a&gt;, pats on the back all around.&lt;br /&gt; &lt;br /&gt; if you need a one-off data point, samhda is overflowing with &lt;a href="http://www.icpsr.umich.edu/icpsrweb/SAMHDA/sda"&gt;options to analyze the data online&lt;/a&gt;. you even might find some &lt;a href="http://www.icpsr.umich.edu/icpsrweb/content/SAMHDA/rdas.html"&gt;restricted statistics&lt;/a&gt; that won't appear in the public use files. still, that's no substitute for getting your hands dirty. when you
tire of &lt;a href="http://www.kaiseredu.org/tutorials/onlinedata/player.html"&gt;menu-driven online query tools&lt;/a&gt; and you're ready to bark with the big data dogs, give these puppies a whirl. the national survey on drug use and health targets the civilian, noninstitutionalized population of the united states aged twelve and older. this new github repository contains three scripts:&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;b&gt;1979-2011 - download all microdata.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;authenticate the university of michi
gan's "&lt;a href="http://www.icpsr.umich.edu/cgi-bin/bob/zipcart2?path=SAMHDA&amp;study=32722"&gt;i agree with these terms&lt;/a&gt;" page&lt;/li&gt; &lt;li&gt;&lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/utils/html/download.file.html"&gt;download&lt;/a&gt;, &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/read.dta.html"&gt;import&lt;/a&gt;, &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/save.html"&gt;save&lt;/a&gt; each available year of data (with documentation) back to 1979 &lt;/li&gt; &lt;li&gt;convert ea
ch pre-packaged stata do-file (.do) into r, run the damn thing, get
&lt;a href="http://www.statmethods.net/input/missingdata.html"&gt;NAs&lt;/a&gt; where they belong&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2010 single-year - analysis examples.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load a single year of data&lt;/li&gt; &lt;li&gt;limit the table to the variables needed for an example analysis &lt;/li&gt; &lt;li&gt;construct the &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.html"&gt;complex sample survey object &lt;/a&gt;&lt;/li&gt; &lt;li&gt;run enough example analyses to make a kitchen sink jealous&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;replicate sam
hsa puf.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load a single year of data &lt;/li&gt; &lt;li&gt;limit the table to the variables needed for an example analysis &lt;/li&gt; &lt;li&gt;construct the &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.html"&gt;complex sample survey object &lt;/a&gt;&lt;/li&gt; &lt;li&gt;print statistics and standard errors matching the &lt;a href="https://github.com/ajdamico/usgsd/blob/master/National%20Survey%20on%20Drug%20Use%20and%20Health/NSDUH%20PUF_Table_1.19B_D%20from%20SAMHSA.pdf?raw=true"&gt;target replicati
on table&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;a href="https://github.com/ajdamico/usgsd/tree/master/National%20Survey%20on%20Drug%20Use%20and%20Health"&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 national survey on drug use and health, visit:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://oas.samhsa.gov/NSDUH.htm"&gt;the substance abuse and mental health services administration's nsduh homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="https://nsduhweb.rti.org/"&gt;research triangle in
stitute's nsduh homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.icpsr.umich.edu/icpsrweb/SAMHDA/series/64"&gt;the university of michigan's nsduh homepage&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; the 'download all microdata' program intentionally breaks unless you complete the clearly-defined, one-step instruction to authenticate that you have read and agree with the download terms. the script will download the entire public use file archive, but only after this step has been completed. if you c
ontact me for help without reading those instructions, i reserve the right to tease you mercilessly. also: thanks to the great
&lt;a href="http://had.co.nz/"&gt;hadley wickham&lt;/a&gt; for figuring out &lt;a href="http://stackoverflow.com/questions/13204503/how-to-use-r-to-download-a-zipped-file-from-a-ssl-page-that-requires-cookies"&gt;how to authenticate in the first place&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, and sudaan users: did you know that you don't have to stop reading just because you've run out of candlewax? maybe it's time to switch to r. :D