BookmarkSubscribeRSS Feed
Saifulinfs
Fluorite | Level 6

Here is the code I used to generate the imputed dataset:

 

proc surveyimpute data=zinc.otms method=hotdeck (selection=weighted) seed=123 ndonors=5;
cluster psu_no_ov;
strata newstrata;
weight nat_weight_bio;
cells sex area;
class cat_smoke sanitation handwashing drinkingwatersource caste alcohol_y_n edu_pat edu_mat;
var cat_smoke sanitation handwashing drinkingwatersource caste alcohol_y_n edu_pat edu_mat N_Mets1 N_Mets2 N_Mets3 N_Mets4 N_Mets5 N_Mets6 N_Mets7 crprt diet p_activity zns_unic sys1 sys2 sys3 dias1 dias2 dias3;
output out=zinc.imputed donorid=donor;
run;


data zinc.imputed;
set zinc.imputed;
if (ImpIndex = 0) then do; /* Include complete respondents */
do _Imputation_=1 to 5; /* in all imputations. */
output;
end;
end;
else do; /* Put incomplete respondents */
_Imputation_ = ImpIndex; /* in separate imputations. */
output;
end;
proc sort data=zinc.imputed;
by _Imputation_ UnitID;
run;

 

then I ran the following regression using the default varmethod=TSL:

 

proc surveyreg data=zinc.imputed;

by _imputation;
cluster psu_no_ov;
strata newstrata;
weight imp_wt;
class cat_zinc;
model N_Mets8 = cat_zinc / solution noint;
contrast 'contrasting example' cat_zinc -3 -1 1 3;
estimate 'overall mean' cat_zinc 0.25 0.25 0.25 0.25;
run;

 

Now, should I combine the results using PROC miANALYZE? OR Should I remove the by _imputation_ statement from the Proc surveyeg step and report the results without using procmianalyze?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 0 replies
  • 279 views
  • 0 likes
  • 1 in conversation