proc contents data=Bmx_j; run; proc contents data=Bpx_j; run; proc contents data=Demo_j; run; proc contents data=Tchol_j; run; proc sort data=Demo_j; by SEQN; run; proc sort data=Bmx_j; by SEQN; run; proc sort data=Bpx_j; by SEQN; run; proc sort data=Tchol_j; by SEQN; run; data comb; merge Demo_j(in=A) Bmx_j(in=B) Bpx_j(in=C) Tchol_j(in=D); by SEQN; if A and B and C and D; run; proc contents data=comb; run; data comb2; set comb; if LBXTC<188 then LBXTC2=0; else LBXTC2=1; keep BMXBMI BPXDI1 BPXSY1 DMDEDUC2 DMDHHSIZ DMDMARTL INDHHIN2 LBXTC RIAGENDR RIDAGEYR RIDRETH1 SDMVPSU SDMVSTRA SEQN WTMEC2YR LBXTC2; where DMDEDUC2 not in (7,9,.) and DMDMARTL not in (77,.) and INDHHIN2 not in (77,99,.) and BMXBMI^=. and BPXDI1^=. and BPXSY1^=. and LBXTC^=. and RIDAGEYR GE 18; run; /*descriptive analysis*/ proc means min P50 mean max std maxdec=2 data=comb2; var BMXBMI BPXDI1 BPXSY1 RIDAGEYR LBXTC; run; proc freq data=comb2; tables DMDEDUC2 DMDHHSIZ DMDMARTL INDHHIN2 RIAGENDR RIDRETH1 LBXTC2/missing list; run; proc surveymeans nmiss mean sum median std data=comb2; var BMXBMI BPXDI1 BPXSY1 RIDAGEYR LBXTC; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run; proc surveyfreq data=comb2; tables DMDEDUC2 DMDHHSIZ DMDMARTL INDHHIN2 RIAGENDR RIDRETH1; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run; /*Binary Association Analysis*/ proc contents data=comb2; run; proc corr data=comb2; var BPXDI1 BPXSY1; run; proc surveyreg data=comb2; class RIDRETH1; model LBXTC=RIDRETH1/solution; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run; proc surveyfreq data=comb2; tables (DMDEDUC2 DMDHHSIZ DMDMARTL RIAGENDR RIDRETH1)*LBXTC2 /row CL chisq; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run; /*multivariate linear regression*/ proc surveyreg data=comb2; class DMDMARTL RIAGENDR RIDRETH1; model LBXTC=BPXDI1 BPXSY1 DMDHHSIZ DMDMARTL RIAGENDR RIDRETH1/solution; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run; /*multivariate logistic regression*/ proc surveylogistic data=comb2; class DMDMARTL RIAGENDR; model LBXTC2(event='1')=BPXDI1 BPXSY1 DMDHHSIZ DMDMARTL RIAGENDR; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run; /*backward manual variable selection*/ proc surveyreg data=comb2; class DMDMARTL RIAGENDR RIDRETH1; model LBXTC=BPXDI1 BPXSY1 DMDHHSIZ DMDMARTL RIAGENDR RIDRETH1/solution; weight WTMEC2YR; strata SDMVSTRA; cluster SDMVPSU; run;