Programming the statistical procedures from SAS

Proc mianalyze / multilevel multinomial logistic regression

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Proc mianalyze / multilevel multinomial logistic regression

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
New Contributor
Posts: 3

Re: Proc mianalyze / multilevel multinomial logistic regression

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;

View solution in original post


All Replies
Respected Advisor
Posts: 2,655

Re: Proc mianalyze / multilevel multinomial logistic regression

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

New Contributor
Posts: 3

Re: Proc mianalyze / multilevel multinomial logistic regression

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
New Contributor
Posts: 3

Re: Proc mianalyze / multilevel multinomial logistic regression

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;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1256 views
  • 2 likes
  • 2 in conversation