09.08.2015 Views

Data User’s Guide

Data User's Guide

Data User's Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2007 YOUTH RISK BEHAVIOR SURVEY3. Example SAS and SAS-callable SUDAAN Program*Assign the locations for the SAS data and format library;libname yrbsdata 'c:\data\yrbs2007';libname library 'c:\data\yrbs2007';* Create a temporary SAS dataset retaining only records that haveweights greater than zero;data yrbs;set yrbsdata.xxh2007_yrbs_data;if weight > 0;* Create a numeric analysis variable for Grade;select (q3);when ('1') grade = 1;when ('2') grade = 2;when ('3') grade = 3;when ('4') grade = 4;otherwise; end;run;* Sort the data by stratum and PSU – this is a SUDAAN requirement;proc sort data=yrbs;by stratum psu;run;* Run the SUDAAN descript procedure analyzing QN10 by grade;proc descript data=yrbs design=wr;nest stratum psu/missunit;weight weight;var qn10;catlevel 1;subgroup grade;levels 4;tables grade;print/style=NCHS;run;46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!