Skip to content

how to read BRFSS file

4 messages · chloe yoon, jim holtman, David Winsemius

#
Exactly what have you tried and what did not work?  I downloaded the
'.asc' (text) version of the data and it appears to be fixed format
with 1294 characters per line; there are about 414K lines of data in
the file.  How much of the data do you need to extract?  You can read
in a portion of the file at a time and then extract just the fields
that you need for processing.  If it is not too many fields, this
should be a reasonable sized object.
On Sat, Nov 21, 2009 at 7:58 PM, chloe yoon <yoon.chloe at gmail.com> wrote:

  
    
#
On Nov 21, 2009, at 7:58 PM, chloe yoon wrote:

            
I am not sure I have the time to create a step by step guide for a  
dataset that is 47 MB long which I don't intend to use. I have  
experience with loading datasets from NCHS from NHANES. Which dataset  
do you intend to use? Perhaps if you posed more discrete questions,  
then people could chime in as you proceeded stap by step.

The data layout for the ASCII data is described on:
http://www.cdc.gov/brfss/technical_infodata/surveydata/2008/varLayout_table_08.htm

So it looks like you will be using either read.sas or read.fwf? Have  
you tried either one? What experiences or preparation have you you to  
report?

  
    
#
On Nov 21, 2009, at 8:41 PM, David Winsemius wrote:

            
Actually, that would be foreign:::read.xport, not read.sas.

After downloading andunzipping the sas xport file, the following  
worked fairly painlessly. There would also be the option of using  
Hmisc:::sasxport.get

library(foreign)
  brfss <- read.xport("/Users/davidwinsemius/Downloads/CDBRFS08.XPT")