Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Importing problem BRFSS SAS file post 2014

    I'm working with BRFSS data 2010-2015. Before 2014, I could open it by clicking the import option and picking SAS EXPORT Version5.(*xpt) , but it doesn't work after 2013. Though, I have all the data from 2010-2015 , I could open the data until 2013.

    I've also tried this following commands :

    import sasxport5 "working directory /LLCP2014.XPT"


    but when I use the above command for data before 2014 ( like 2013,2012, and 2010 ) it works. But, for 2014 and post 2014 , it says - LLCP2014.XPT not found

    My data on my Mac before 2014 is saved as document file but the data for 2014 and post 2014 is saved as textedit format ( though I downloaded all of them as sas file from BRFSS website ).

    Could anyone tell me what's the issue I'm having ?

    Thanks in advance !

  • #2
    There are a few years in BRFSS, when the file was decompressed in Mac, the file name became "LLCP####.xpt " (notice that space at the end). This causes the xpt extension unrecognized. Try to use the Finder and see if there are any extra space at the unzipped xpt file, and remove it accordingly.

    Comment


    • #3
      There was a similar thread recently that I think has the same underlying issue. I'd bet that BRFSS data began to be exported using compression, which Stata is apparently unable to handle. If you can get this data in ASCII format with a Stata import do file, that would be best. Otherwise you will need a program to export to something Stata can use, such as SAS, Stat/Transfer or perhaps R.

      Comment


      • #4
        I tried with the 2017 data and was able to import the XPT (version 5) file into Stata using -import sasxprt5- without issue. However, when unzipping the datafile, the file extension was ".XPT_", so it seems there was an unnecessary underscore character that might be causing you problems, similar to Ken's suggestion.

        Comment


        • #5
          I tried this myself. (ion a Linux machine) and found that the extracted filename - LLCP2014.XPT has an invisible non-graphic character after the "T". If you list files with the "-b" option it will show up as a backslash-space. If you rename the file (using a wildcard) it should be readable. At least Stat/Transfer was able to translate it.

          Comment


          • #6
            Originally posted by Leonardo Guizzetti View Post
            I tried with the 2017 data and was able to import the XPT (version 5) file into Stata using -import sasxprt5- without issue. However, when unzipping the datafile, the file extension was ".XPT_", so it seems there was an unnecessary underscore character that might be causing you problems, similar to Ken's suggestion.
            I downloaded the ASC version ( has the ppt version too in the same folder for post 2014 which is also saved in textedit format ) and when unzipping it opens intextedit format. I can't use the unarchiver app to unzip it , I need to double click and it opens as textedit format.

            I attached the image on my laptop so that you can understand if anything is wrongly downloaded or stored.

            Attached Files

            Comment


            • #7
              Originally posted by Ken Chui View Post
              There are a few years in BRFSS, when the file was decompressed in Mac, the file name became "LLCP####.xpt " (notice that space at the end). This causes the xpt extension unrecognized. Try to use the Finder and see if there are any extra space at the unzipped xpt file, and remove it accordingly.
              Thanks for your kind suggestion. But, even after addressing the space issue , it's still showing me problem like the following :

              . import sasxport5 "/Users/Documents/BRFSS /LLCP2014.XPT_"

              file /Users//Documents/BRFSS /LLCP2014.XPT_ not found

              Though, I found it on finder, I'm not sure why the space is still there despite me not finding it on finder.

              Comment


              • #8
                Originally posted by [email protected] View Post
                I tried this myself. (ion a Linux machine) and found that the extracted filename - LLCP2014.XPT has an invisible non-graphic character after the "T". If you list files with the "-b" option it will show up as a backslash-space. If you rename the file (using a wildcard) it should be readable. At least Stat/Transfer was able to translate it.
                Renaming the file worked like magic ! Thanks so much for this kind response which solved the problem I've been having. Much appreciated 😇

                Comment


                • #9
                  Thanks to everyone for giving me your valuable time to address the issue at hand. Much appreciated !

                  Comment


                  • #10
                    Last time all of you were kind and patient enough to hear out my problem , therefore would like to ask for one more suggestion if it permits your time.

                    After cleaning the BRFSS data for sample ranging from 2005-2015 I need to append the data. But, before doing it should I use the following command or should I use the _finalwt option while running a regression

                    use brfss2010.dta, clear
                    svyset _psu [pweight= _finalwt], strata( _ststr)

                    Right now my regression looks like the following . One confusion is what I would do post-2011 for weighting where _llcpwt is available which means besides landline cellphones were also introduced for interviewing respondents ?

                    reg insured male age_18_34 age_35_49 age_50_64 highschool lths bachelorplus white black asian income_group [aw=_finalwt ], cluster(statefip)

                    Thanks in advance.

                    Comment

                    Working...
                    X