************************************************************************ * Program: C:\NHANES\.sas * * Proposal: * ************************************************************************; LIBNAME NH "C:\NHANES\DATA"; OPTIONS NODATE NOCENTER; option ls=72; proc format; VALUE sexfmt 1 = 'Male' 2 = 'Female' ; VALUE racefmt 1 = 'NH-White' 2 = 'NH-Black' 3 = 'Mex-Am' 4 = 'Other' ; VALUE agefmt 1 = '20-39' 2 = '40-59' 3 = '60+' ; value selfmt 1 = 'Age ge 20' 2 = 'Age lt 20' ; run; DATA ANALYSIS_DATA; SET NH.ANALYSIS_DATA; if ridstatr = 2; ***examined ; if ridageyr ge 20 then sel=1; else sel=2; age = .; if 20 LE ridageyr LE 39 then age=1; if 40 LE ridageyr LE 59 then age=2; if ridageyr GE 60 then age=3; race=.; if ridreth1=3 then race=1; if ridreth1=4 then race=2; if ridreth1=1 then race=3; if ridreth1=2 or ridreth1=5 then race=4; LABEL age = 'AGE GROUP' race = 'Race Ethnicity' riagendr = 'Gender' sel = 'Subpop: 1=age ge 20 2=age lt 20' ; RUN; title ' '; proc surveymeans data=analysis_data mean nobs stderr; strata sdmvstra; cluster sdmvpsu; weight wtmec4yr; class riagendr race; domain sel sel*riagendr sel*race sel*riagendr*race; var bmxbmi; ods OUTPUT domain(match_all)=unadj; format age agefmt.; format riagendr sexFMT.; format race racefmt. ; run; data stats; set unadj unadj1 unadj2 unadj3; if sel=1 ; /*keep ages ge 20*/ proc sort; by riagendr race; proc print; var race riagendr n mean stderr; run;