******************************************************************************************** *** New York City Youth Risk Behavior Survey (YRBS) 1997 *** 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: Strat psu SURVEY WEIGHT: Wt DESIGN: With replacement ********************************; libname yrbs97 '< >'; filename formatin '< >\yrbs97-formatstatements.sas'; %include '< >\yrbs97-formats.sas'; data y97; set yrbs97.yrbs1997; run; proc contents data=y97; run; /*SAMPLE SUDAAN CODE*/ proc sort data=y97; by strat psu; run; proc descript data=y97 filetype=sas design=wr nomarg; nest strat psu; weight wt; var eversex eversex; catlevel 1 2; tables _one_ ; class _one_ /nofreq; setenv decwidth=1; print nsum percent sepercent lowpct uppct/style=nchs; output/filename=out97 filetype=sas tablecell=default replace; run; /*CHECK RELIABILITY*/ /*use output dataset to calculate RSE and reliability*/ data check1; set out97; 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*/