General Instructions for Opening IPUMS YRBSS Data

The IPUMS YRBSS data are provided as a single raw ASCII data file with the command files necessary for reading the raw data into SPSS, Stata, SAS, and R.

To analyze data, you must first download the data and command file for your statistics package of choice. First, right click on the "data" link and select "Save Link As". Next, right click on the command file link of your choice and select "Save Link As".

All IPUMS datasets come compressed. There are many applications available for decompressing files. The links below direct you to some of the more popular shareware and freeware programs.

  • WinZip and WinRAR are also popular compression applications for Windows. WinRAR is also available for Mac and Linux.
  • MacGZIP and Stuffit Expander are the most popular compression applications for Macs

SPSS Users

  1. Unzip your data file.
  2. Open the SPSS command file in SPSS.
  3. Find the line at the top that reads:
    • cd ".".
    • If the ".dat" data file is on your C drive, for instance, you need to change that line to:
    • cd "C:\
  4. Click the "Run" menu and select "All". SPSS will then read in your data.

If you do not get any errors, but you do not see data in the data editor, click the "Transform" menu and select "Run Pending Transformations".

STATA Users

  1. Unzip your data file.
  2. Save the Stata ".do" command file in the same directory as you saved the ".dat" data file.
  3. Make sure Stata is pointing to the directory that contains the ".dat" data file and the ".do" command file. If these files are on your C drive, for instance, you should type:
    • cd "C:\"
  4. Execute the ".do" file. For example, if your .do file is named "ipums-yrbss.do", you will need to type:
    • do ipums-yrbss.do

You will see ‘end of do-file’ when STATA has finished reading in the data.

SAS Users

  1. Unzip your data file.
  2. Open the SAS command file in SAS.
  3. Change one line in your SAS command file to indicate the location of the ".dat" data file on your computer. If your IPUMS YRBSS file is called ipums-yrbss.sas and ipums-yrbss.dat, then the libname line in the ".sas" command file will read:
    • libname IPUMS ".";
  4. If the ".dat" data file is in a folder on your C drive, for instance, then you need to change that line to:
    • libname IPUMS "C:\";
  5. Click the "Run" menu and select "Submit." SAS will then read in your data.

R Users

  1. (Optional) Unzip your data file (in general, R can read the zipped version, but it may be faster if you unzip first).
  2. Save the YML (yrbss.yml) and R ".R" script file in the same directory as you saved the ".dat" data file.
  3. Make sure R is pointing to the directory that contains the ".dat" data file "yml" data dictionary file. If these files are on your C drive, for instance, you should type:
    • - setwd("C:\")
  4. Execute the ".R" file. For example, if your .r file is named "ipums-yrbss.R", you will need to type:
    • - source("ipums-yrbss.R")