proc contents data=Demo_J; run; /*Check variables*/ proc freq data=Demo_J; tables DMDEDUC2 DMDHHSIZ DMDMARTL RIAGENDR RIDRETH1 INDFMIN2/missing list; run; proc means n nmiss min P25 P50 P75 max mean std maxdec=2 data=Demo_J; var RIDAGEYR; run; data indat; set Demo_J; DMDEDUC2_I=DMDEDUC2; if DMDEDUC2 in (7,9) then DMDEDUC2_I=.; DMDMARTL_I=DMDMARTL; if DMDMARTL=77 then DMDMARTL_I=.; INDFMIN2_I=INDFMIN2; if INDFMIN2 in (77,99) then INDFMIN2_I=.; where RIDAGEYR GE 18; run; proc freq data=indat; tables DMDEDUC2*DMDEDUC2_I DMDMARTL*DMDMARTL_I INDFMIN2*INDFMIN2_I /missing list; run; proc mi nimpute=5 seed=489741 data=indat out=mindat; class DMDEDUC2_I DMDMARTL_I RIAGENDR RIDRETH1; fcs discrim(DMDEDUC2_I/CLASSEFFECTS=INCLUDE); fcs discrim(DMDMARTL_I/CLASSEFFECTS=INCLUDE); *fcs logistic (DMDEDUC2_I/ link=glogit); *fcs logistic (DMDMARTL_I/ link=glogit); fcs regpmm(INDFMIN2_I); var RIDAGEYR DMDHHSIZ RIAGENDR RIDRETH1 DMDEDUC2_I DMDMARTL_I INDFMIN2_I; run; proc freq data=mindat; tables DMDEDUC2*DMDEDUC2_I DMDMARTL*DMDMARTL_I INDFMIN2*INDFMIN2_I /missing list; run; /*Regression*/ proc sort data=mindat; by _Imputation_; run; ods select none; proc genmod data=mindat; class RIAGENDR RIDRETH1 DMDEDUC2_I DMDMARTL_I; model INDFMIN2_I= RIDAGEYR DMDHHSIZ RIAGENDR RIDRETH1 DMDEDUC2_I DMDMARTL_I/covb; by _Imputation_; ods output ParameterEstimates=gmparms; run; ods select all; proc print data=gmparms (obs=8); var _Imputation_ Parameter Estimate StdErr; title 'GENMOD Model Coefficients (First Two Imputations)'; run; proc mianalyze parms(classvar=level)=gmparms; class RIAGENDR RIDRETH1 DMDEDUC2_I DMDMARTL_I; modeleffects Intercept RIDAGEYR DMDHHSIZ RIAGENDR RIDRETH1 DMDEDUC2_I DMDMARTL_I; run;