turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Proc mianalyze / multilevel multinomial logistic r...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-10-2015 03:01 AM

Dear SAS users,

I would like to perfom a multilevel multinomial logistic regression analysis on a dataset with missing values. I have a problem with proc mianalyze. My outcome has 3 levels ("area_tert": 1, 2, 3). While for each imputed data set, I obtain estimates for each covariate at each outcome level, when I combine the estimates, i.e. using proc mianalyze, I only obtain one estimate for each covariate, and not at each outcome level (2 and 3) and don't understand these pooled estimates!

Could you please help me?

Many thanks!

Below is my syntax:

title "analysis per imputed dataset ";

proc glimmix data=imputed method=RSPL noclprint ;

class id;

model area_tert (order=freq ref='1')=age gender Education / link=glogit dist=multinomial solution;

nloptions tech=newrap;

random Intercept / subject=id group=area_tert;

by _imputation_;

ods output ParameterEstimates=gparms FitStatistics=gfitstats CovParms=randomeffect;

run;

title "combined results - fixed effects";

proc mianalyze parms=gparms;

modeleffects Intercept age gender Education;

stderr Intercept age gender Education;*/

run;

title "combined results - random effect";

proc mianalyze data=Randomeffect;

modeleffects estimate ;

stderr stderr;

run;

Best regards,

Accepted Solutions

Solution

09-29-2015
08:51 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-29-2015 08:50 AM

I received a response from SAS support (thanks!). The main idea is to sort the different levels of the depend variable.

I share with you the script sent by SAS support to solve the problem.

Best regards,

/*Sample data set that assumes the imputation has already been done*/

data test;

seed=2534565;

do _imputation_=1 to 2;

do subj=1 to 60;

do a=1 to 3;

do rep=1 to 3;

ind1=ranuni(seed)*subj;

int=-1+rannor(31221)*_imputation_;

logit=int + .05*ind1-.67*a;

p=exp(-logit)/(1+exp(-logit));

if ranuni(seed)>p then y=1;

else if ranuni(314)>.5 then y=2;

else y=3;

output;

end;

end;

end;

end;

run;ods trace on;

proc glimmix data=test;

class y a subj;

model y=ind1 a/link=glogit dist=multi solution;

by _Imputation_;

random intercept /subject=subj solution group=y;

ods output parameterestimates=parms solutionr=rand_parms;

run;

/*Fixed effects*/

/*Need to sort by the different levels of the response variable so that MIANALYZE will*/

/*give the output for each logit function*/

proc sort data=parms;

by y _imputation_;

run;

proc mianalyze parms=parms;

class a;

modeleffects intercept a ind1;

by y;

run;

/*Fixed effects*/

/*Need to sort by the different levels of the response variable so that MIANALYZE will*/

/*give the output for each logit function*/

proc print data=rand_parms;

run;

proc sort data=rand_parms;

by subject group _imputation_;

run;

proc mianalyze parms=rand_parms(rename=(stderrpred=stderr));

modeleffects intercept;

by subject group;

run;

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-10-2015 08:49 AM

Go straight to Tech Support with this one. PROC MIANALYZE is notorious (at least here in the SAS Statistical Procedures community) for not playing well with the output of the mixed models procedures, as the necessary matrices don't seem to conform to the types that are needed in MIANALYZE. If you get a good answer from TS, please, please, please share it here (or write an SGF paper on it) so that we can get some resolution.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-10-2015 12:05 PM

Thanks for your suggestion.

I have contacted Tech Support.

If I get an explanation, I will share it here.

Best regards.

Solution

09-29-2015
08:51 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-29-2015 08:50 AM

I received a response from SAS support (thanks!). The main idea is to sort the different levels of the depend variable.

I share with you the script sent by SAS support to solve the problem.

Best regards,

/*Sample data set that assumes the imputation has already been done*/

data test;

seed=2534565;

do _imputation_=1 to 2;

do subj=1 to 60;

do a=1 to 3;

do rep=1 to 3;

ind1=ranuni(seed)*subj;

int=-1+rannor(31221)*_imputation_;

logit=int + .05*ind1-.67*a;

p=exp(-logit)/(1+exp(-logit));

if ranuni(seed)>p then y=1;

else if ranuni(314)>.5 then y=2;

else y=3;

output;

end;

end;

end;

end;

run;ods trace on;

proc glimmix data=test;

class y a subj;

model y=ind1 a/link=glogit dist=multi solution;

by _Imputation_;

random intercept /subject=subj solution group=y;

ods output parameterestimates=parms solutionr=rand_parms;

run;

/*Fixed effects*/

/*Need to sort by the different levels of the response variable so that MIANALYZE will*/

/*give the output for each logit function*/

proc sort data=parms;

by y _imputation_;

run;

proc mianalyze parms=parms;

class a;

modeleffects intercept a ind1;

by y;

run;

/*Fixed effects*/

/*Need to sort by the different levels of the response variable so that MIANALYZE will*/

/*give the output for each logit function*/

proc print data=rand_parms;

run;

proc sort data=rand_parms;

by subject group _imputation_;

run;

proc mianalyze parms=rand_parms(rename=(stderrpred=stderr));

modeleffects intercept;

by subject group;

run;