******************************************************************************************** *** New York City Youth Risk Behavior Survey (YRBS) 2007 *** Call-in program and sample code *** For questions about analysis, please contact us at epidatarequest@health.nyc.gov *********************************************************************************************; ************************************************************************************************** Users will need to modify this code to call-in the data. Enter in the folder path where you have saved the dataset and format/format statements, as indicated by < >. Remove the < > before running the program. *****************************************************************************************************; ******************************* NEST: Stratum psu SURVEY WEIGHT: Weight DESIGN: With replacement ********************************; libname yrbs07 '< >'; filename formatin '< >\yrbs07-formatstatementsnumeric.sas'; %include '< >\yrbs07-formatnumericR.sas'; data y07; set yrbs07.yrbs2007; run; proc contents data=y07; run; /*note: variables beginning with NQ are equivalent to the variables beginning with Q in the codebook*/ /*SAMPLE SUDAAN CODE*/ proc sort data=y07; by stratum psu; run; proc descript data=y07 filetype=sas design=wr nomarg; nest stratum psu; weight weight; var qn30 qn30; catlevel 1 2; tables _one_ borough ; class _one_ borough/nofreq; setenv decwidth=1; print nsum percent sepercent lowpct uppct/style=nchs; output/filename=out07 filetype=sas tablecell=default replace; run; /*CHECK RELIABILITY*/ /*use output dataset to calculate RSE and reliability*/ data check1; set out07; if percent in (0.00, 100.00) then do; if nsum >= 50 then flag = '**'; if nsum < 50 then flag = '^'; end; if percent not in (0.00, 100.00) then do; rse = sepercent/percent; ciband = uppct-lowpct; halfw = ciband/2; if rse =>0.5 then do; if ciband >=6 then flag='^'; else if ciband < 6 then flag = '*'; end; else if rse < 0.3 then do; if nsum <50 then flag='*'; else if nsum >= 50 then do; if halfw > 10 then flag = '*'; end; end; else if 0.5 > rse >=0.3 then flag='*'; end; run; /*print out all obeservations that meet flag/suppression criteria*/ options ls = 150; proc print data = check1 noobs; var flag rse nsum ciband halfw percent lowpct uppct; where flag in ('*','^', '**'); run; /*remember what each of the different flags mean! * = reliability note ("Estimate should be interpreted with caution. Esimate's Relative Standard Error (a measure of estimate precision) is greater than 30%, or the 95% Confidence Interval's half width is greater than 10, or the sample size is too small making the estimate potentially unreliable") ^ = suppression note ("Data are suppressed due to imprecise and unreliable estimates") ** = confidence interval note ("Estimate should be interpreted with caution. 95% Confidence Interval and Relative Standard Error are not calculated") */ /*Be sure to include other relevant notes as necessary*/