BookmarkSubscribeRSS Feed
Saifulinfs
Fluorite | Level 6
I wish to test for linear trend across 4 categories of my outcome variable. My data come from a complex survey design. Missing data have veen imputed by proc surveyimpute procedure.

Could you let me know how to combine results from ‘’Contrast” statement in the proc surveyreg procedure using proc MIanalyze? I got auggestion from using Estimate statement but not sure how to test for trend using estimate statement.
4 REPLIES 4
Zard
SAS Employee

PROC SURVEYIMPUTE generates imputation-adjusted replicate weights that you then use in another survey procedure. This is different than a multiply imputed data set, so you do not need to use PROC MIANALYZE. Instead, read the imputed data into PROC SURVEYREG and specify the replication method for variance estimation using the VARMETHOD= option. The imputation variance will be accounted for. The Getting Started example in PROC SURVEYIMPUTE explains it well.

Saifulinfs
Fluorite | Level 6

Thank you for your response. Because my dataset has a mixture of continuous and class variables, I used Method=Hotdeck and Varmethod=None in my Proc Surveyimpute. This means no replicate weights were created. Only imputation-adjusted survey weights were created. In this case, do I need to use Proc MIanalyze procedure? If not, which varmethod option should I use in proc surveyreg?

 

Please note that, I initially tried with Method=FEFI and Varmethod=Jackknife. But SAS didn't gave imputed dataset even after running the Proc SURVEYIMPUTE procedure for 48 hours. I later came to know this is because my dataset had several continuous variables in addition to class variables.

Zard
SAS Employee

You would use SURVEYREG with the default VARMETHOD=TAYLOR.

Saifulinfs
Fluorite | Level 6

Here is the code I used to generated the 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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 862 views
  • 0 likes
  • 2 in conversation