DOI: 10.7910/dvn/b7hmxz
title: Behavioral Risk Factor Surveillance System (BRFSS)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the behavioral risk factor surveillance system (brfss) with r and monetdb &lt;/h3&gt; experimental. the behavioral risk factor surveillance system (brfss) aggregates behavioral health data from 400,000 adults via telephone every year. it's um *clears throat* the largest telephone survey in the world and it's gotta lotta uses, &lt;a href="http://www.cdc.gov/brfss/dataused.htm"&gt;here's a list neato&lt;/a&gt;. state health departments perform the actual d
ata collection (according to a nationally-standardized protocol and a core set of questions), then forward all responses to
&lt;a href="http://www.cdc.gov/"&gt;the centers for disease control and prevention&lt;/a&gt; (cdc) &lt;a href="http://www.cdc.gov/osels/"&gt;office of surveillance, epidemiology, and laboratory services&lt;/a&gt; (osels) where the nationwide, annual data set gets constructed. independent administration by each state allows them to tack on &lt;a href="http://apps.nccd.cdc.gov/BRFSSModules/ModByState.asp?Yr=2010"&gt;their own questions&lt;/a&gt; that other states might not care about. that way, florida could exempt itself from all t
he &lt;a href="http://www.digitalspy.co.uk/movies/i427573-8/dumb-and-dumber-stills-dumb-and-dumber-jeff-daniels.html"&gt;risky frostbite behavior&lt;/a&gt; questions. in addition to providing the most comprehensive behavioral health data set in the united states, brfss also eeks out my worst acronym in the federal government award - &lt;a href="http://healthit.hhs.gov/"&gt;onchit&lt;/a&gt; a close second.&lt;br /&gt; &lt;br /&gt; annual brfss data sets have grown rapidly over the past half-decade: the 1984 data set contained only
12,258 respondents from 15 states, all states were participating by 1994, and the 2011 file has surpassed half a million interviews. if you're examining trends over time, do your homework and review the
&lt;a href="http://www.cdc.gov/brfss/technical_infodata/surveydata.htm"&gt;brfss technical documents&lt;/a&gt; for the years you're looking at (plus any years in between). what might you find? well for starters, the cdc switched to &lt;a href="http://www.cdc.gov/surveillancepractice/reports/brfss/brfss.html"&gt;sampling cellphones in their 2011 methodology&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; unlike many u.s. government surveys, brfss is not conducted for each resident at a sampled household (phone number). only one respondent per
phone number gets interviewed. did i miss anything? well if your next question is frequently asked,
&lt;a href="http://www.cdc.gov/brfss/faqs.htm"&gt;you're in luck&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; all brfss files are available in sas transport format so if you're sittin' pretty on 16 gb of ram, you could potentially &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/read.xport.html"&gt;read.xport&lt;/a&gt; a single year and create a &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.html"&gt;taylor-series survey object&lt;/a&gt; using &lt;a href="http://faculty.washington.edu/tlumley/survey/"&gt;the sur
vey package&lt;/a&gt;. cool. but hear me out: the download and importation script builds an ultra-fast monet database (click here for &lt;a href="http://www.asdfree.com/2013/03/column-store-r-or-how-i-learned-to-stop.html"&gt;speed tests, installation instructions&lt;/a&gt;) on your local hard drive. after that, these scripts are shovel-ready. consider importing all brfss files my way - let it run overnight - and during your actual analyses, code will run a lot faster. the brfss generalizes to the u.s. adult (18+
) (non-institutionalized) population, but if you don't have a phone, you're probably out of scope. this new github repository contains four scripts:
&lt;br /&gt; &lt;br /&gt; &lt;b&gt;1984 - 2011 download all microdata.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;create the batch (.bat) file needed to initiate the monet database in the future&lt;/li&gt; &lt;li&gt;download, unzip, and import each year specified by the user&lt;/li&gt; &lt;li&gt;create and save the taylor-series linearization complex sample designs&lt;/li&gt; &lt;li&gt;create a well-documented block of code to re-initiate the monetdb server in the future&lt;b&gt; &lt;/b&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2011 single-year - analysis examples.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;run the well-d
ocumented block of code to re-initiate the monetdb server &lt;/li&gt; &lt;li&gt;load the &lt;a href="http://astrostatistics.psu.edu/su07/R/html/base/html/load.html"&gt;r data file&lt;/a&gt; (.rda) containing the taylor-series linearization design for the single-year 2011 file&lt;/li&gt; &lt;li&gt;perform the standard repertoire of analysis examples, only this time using &lt;a href="http://sqlsurvey.r-forge.r-project.org/"&gt;sqlsurvey&lt;/a&gt; functions&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2010 single-year - variable recode example.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;run
the well-documented block of code to re-initiate the monetdb server
&lt;/li&gt; &lt;li&gt;copy the single-year 2010 table to maintain the pristine original&lt;/li&gt; &lt;li&gt;add a new drinks per month category variable by hand&lt;/li&gt; &lt;li&gt;re-create then save the &lt;a href="http://sqlsurvey.r-forge.r-project.org/"&gt;sqlsurvey&lt;/a&gt; taylor-series linearization complex sample design on this new table&lt;/li&gt; &lt;li&gt;close everything, then load everything back up in a fresh instance of r&lt;/li&gt; &lt;li&gt;replicate statistics from &lt;a href="https://github.com/ajdamico/usgsd/blob/master/Behavioral%20Risk%20Factor
%20Surveillance%20System/WEAT%202010%20Alcohol%20Consumption%20by%20Gender%20-%20Crosstab%20Analysis%20Results.pdf?raw=true"&gt;this table
&lt;/a&gt;, pulled from the cdc's &lt;a href="http://apps.nccd.cdc.gov/s_broker/WEATSQL.exe/weat/index.hsql"&gt;web-enabled analysis tool&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;replicate cdc weat - 2010.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;run the well-documented block of code to re-initiate the monetdb server &lt;/li&gt; &lt;li&gt;load the r data file (.rda) containing the taylor-series linearization design for the single-year 2010 file&lt;/li&gt; &lt;li&gt;replicate statistics from &lt;a href="https://github.com/ajdamico/usgsd/blob/master/Behavioral%20Risk%20Fa
ctor%20Surveillance%20System/WEAT%202010%20Asthma%20Status%20-%20Crosstab%20Analysis%20Results.pdf?raw=tru
e"&gt;this table&lt;/a&gt;, pulled from the cdc's &lt;a href="http://apps.nccd.cdc.gov/s_broker/WEATSQL.exe/weat/index.hsql"&gt;web-enabled analysis tool&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;a href="https://github.com/ajdamico/usgsd/tree/master/Behavioral%20Risk%20Factor%20Surveillance%20System"&gt;click here to view these four scripts&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; for more detail about the behavioral risk factor surveillance system, visit:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;the centers for disease control and prevention beh
avioral risk factor surveillance system &lt;a href="http://www.cdc.gov/brfss/"&gt;homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;the behavioral risk factor surveillance system &lt;a href="http://en.wikipedia.org/wiki/Behavioral_Risk_Factor_Surveillance_System"&gt;wikipedia entry&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; if you're just scroungin' around for a few statistics, the cdc's &lt;a href="http://apps.nccd.cdc.gov/s_broker/weatsql.exe/weat/index.hsql"&gt;web-enabled analysis tool (weat)&lt;/a&gt; might be all your heart desires. in fact
, on slides seven, eight, nine of &lt;a href="http://www.kaiseredu.org/Tutorials-and-Presentations/Conducting-Research-with-Online-Data-Query-Tools.aspx"&gt;my online query tools video&lt;/a&gt;, i demonstrate how to use this table creator. weat's more advanced than most web-based survey analysis - you can run a regression. but only seven (of eighteen) years can currently be queried online.&lt;br /&gt; &lt;br /&gt; since &lt;a href="http://www.monetdb.org/Documentation/Manuals/SQLreference/BuiltinTypes"&gt;data types in sql
&lt;/a&gt; are not as plentiful as they are &lt;a href="http://www.statmethods.net/input/datatypes.html"&gt;in the r language&lt;/a&gt;, the definition of a monet database-backed complex design object requires a cutoff be specified between the categorical variables and the linear ones. that cut point gets defined using the check.factors argument in the sqlsurvey() and sqlrepsurvey() function calls. check.factors defaults to ten, but can be raised or lowered as needed. here's how it works:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;if
the column would be a &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/character.html"&gt;character string&lt;/a&gt; or &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/factor.html"&gt;factor&lt;/a&gt; inside an &lt;a href="http://www.r-tutor.com/r-introduction/data-frame"&gt;r data frame&lt;/a&gt;, the sql database stores it as a &lt;a href="http://www.monetdb.org/Documentation/Manuals/SQLreference/BuiltinTypes"&gt;varchar&lt;/a&gt; column.&lt;/li&gt; &lt;li&gt;if the column would be &lt;a href="http://stat.ethz.ch/R
-manual/R-patched/library/base/html/numeric.html"&gt;numeric&lt;/a&gt; or &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/integer.html"&gt;integer&lt;/a&gt; in an &lt;a href="http://www.r-tutor.com/r-introduction/data-frame"&gt;r data frame&lt;/a&gt;, but has fewer than eleven &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/base/html/unique.html"&gt;unique&lt;/a&gt; values, the sql database also stores it as a &lt;a href="http://www.monetdb.org/Documentation/Manuals/SQLreference/BuiltinTypes"&gt;varchar&lt;/a&gt; column.&lt;
/li&gt; &lt;li&gt;if the column would be &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/numeric.html"&gt;numeric&lt;/a&gt; or &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/integer.html"&gt;integer&lt;/a&gt; in an &lt;a href="http://www.r-tutor.com/r-introduction/data-frame"&gt;r data frame&lt;/a&gt;, but has at least eleven &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/base/html/unique.html"&gt;unique&lt;/a&gt; values, the sql database stores it as a &lt;a href="http://www.monetdb.org/Documentation/
Manuals/SQLreference/BuiltinTypes"&gt;double&lt;/a&gt; (that's sql-speak for numeric).&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, sudaan users: when statistical languages are plotted on cartesian coordinates, what-you-paid-for vs. what-you-get are best represented as y = 1/x. time to transition to r. :D