<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic proc mianalyze parms  with GLIMMIX model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mianalyze-parms-with-GLIMMIX-model/m-p/610880#M29572</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running into an issue working with multiply imputed data and PROC GLIMMIX. Some background information, this is a large dataset with ~2.6 million observations, with about 200k missing some basic demographic information which I imputed (race, sex, insurance status).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a multilevel design with patients nested inside of hospitals. The outcome is binary with categorical predictors. Race has 6 levels, and region has 4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*MULTIPLE IMPUTATION PHASE*;

proc mi data= a.methadone_epi_11_20_19 nimpute=0 ;
var race sex insurance region hospital_number  age_day_admit ethnicity;
ods select misspattern;
run;

proc mi data= a.methadone_epi_11_20_19 nimpute=40 out=mi_fcs ;
class race sex insurance;
var race sex insurance region hospital_number ethnicity ;
fcs logistic(race= region hospital_number ethnicity/link=glogit) ;
fcs logistic(sex = region hospital_number ethnicity /link=glogit) ;
fcs logistic(insurance = region hospital_number ethnicity /link=glogit);  
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;&lt;BR /&gt;*MODEL TO INVESTIGATE EFFECT OF HOSPITAL ON GETTING AN OPIOID;
PROC GLIMMIX DATA=mi_fcs ;
by _imputation_; 
CLASS hospital_number;
MODEL opioid (EVENT='1')=/cl dist=binary link=logit ddfm=bw solution oddsratio;
RANDOM INTERCEPT / subject=hospital_number type=VC solution CL;
COVTEST /WALD;
ods output parameterestimates=parms1 solutionr=rand_parms1;
run;

proc sort data=parms1;
by _imputation_;
run;

proc mianalyze parms=parms1;
modeleffects intercept ;
run;

proc sort data=rand_parms1;
by subject  _imputation_;
run;

proc mianalyze parms=rand_parms1(rename=(stderrpred=stderr));
modeleffects intercept;
by subject ;
run;


*MODEL 2 ADDING IN PATIENT LEVEL DEMOGRAPHICS;
proc glimmix data = mi_fcs;
by _imputation_; 
 class hospital_number  insurance (ref = '0') sex  ethnicity (ref = '2') race (ref = '1');
 model opioid (event = '1') = sex race ethnicity insurance / CL dist=bianary link=logit solution ODDSRATIO;
 random intercept  / subject=hospital_number solution CL ;
 COVTEST / WALD;
ods output parameterestimates=parms2 solutionr=rand_parms2;
run; 

proc sort data=parms2;
by _imputation_;
run;

proc mianalyze parms=parms2;
class sex race ethnicity insurance;
modeleffects intercept sex race ethnicity insurance;
run;

proc sort data=rand_parms2;
by subject  _imputation_;
run;

proc mianalyze parms=rand_parms2(rename=(stderrpred=stderr));
modeleffects intercept;
by subject ;
run;



*MODEL 3 ADDING IN HOSPITAL REGION;
proc glimmix data = mi_fcs;
by _imputation_; 
 class hospital_number  insurance (ref = '0') sex region (ref = '3') ethnicity (ref = '2') race (ref = '1');
 model opioid (event = '1') = sex race ethnicity insurance region   / CL dist=binary link=logit solution ODDSRATIO ;
 random intercept  / subject=hospital_number type=VC solution CL ;
 COVTEST / WALD;
ods output parameterestimates=parms3 solutionr=rand_parms3;
run; 

data parms3b;
set parms3;
if _Imputation_ = 1 then delete; 
run;

proc sort data=parms3;
by _imputation_;
run;

proc mianalyze parms (classvar=full) =parms3;
class sex race ethnicity insurance region;
modeleffects intercept sex race ethnicity insurance region;
run;

proc sort data=rand_parms3;
by subject  _imputation_;
run;

proc mianalyze parms=rand_parms3(rename=(stderrpred=stderr));
modeleffects intercept;
by subject ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm relatively new to using SAS, but everything seems to be working up to the third model where I add in the variable "region." The model runs, however it fails to converge on imputation #4, #10, #19, #21, and #25.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to combine the parameter estimates following the model, I get the below message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;600  proc mianalyze parms (classvar=full) =parms3;
601  class sex race ethnicity insurance region;
602  modeleffects intercept sex race ethnicity insurance region;
603  run;

ERROR: Within-imputation observations not found for _Imputation_= 4 in the input PARMS= data set.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unfamiliar with how to go about troubleshooting this, is it best to tackle the convergence issue or is there a method for dropping the imputations that did not converge from the parameter estimates that are being fed into the mi analyze procedure?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if there's additional information that I should include in this post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2019 16:15:07 GMT</pubDate>
    <dc:creator>Shad</dc:creator>
    <dc:date>2019-12-11T16:15:07Z</dc:date>
    <item>
      <title>proc mianalyze parms  with GLIMMIX model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mianalyze-parms-with-GLIMMIX-model/m-p/610880#M29572</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running into an issue working with multiply imputed data and PROC GLIMMIX. Some background information, this is a large dataset with ~2.6 million observations, with about 200k missing some basic demographic information which I imputed (race, sex, insurance status).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a multilevel design with patients nested inside of hospitals. The outcome is binary with categorical predictors. Race has 6 levels, and region has 4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*MULTIPLE IMPUTATION PHASE*;

proc mi data= a.methadone_epi_11_20_19 nimpute=0 ;
var race sex insurance region hospital_number  age_day_admit ethnicity;
ods select misspattern;
run;

proc mi data= a.methadone_epi_11_20_19 nimpute=40 out=mi_fcs ;
class race sex insurance;
var race sex insurance region hospital_number ethnicity ;
fcs logistic(race= region hospital_number ethnicity/link=glogit) ;
fcs logistic(sex = region hospital_number ethnicity /link=glogit) ;
fcs logistic(insurance = region hospital_number ethnicity /link=glogit);  
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;&lt;BR /&gt;*MODEL TO INVESTIGATE EFFECT OF HOSPITAL ON GETTING AN OPIOID;
PROC GLIMMIX DATA=mi_fcs ;
by _imputation_; 
CLASS hospital_number;
MODEL opioid (EVENT='1')=/cl dist=binary link=logit ddfm=bw solution oddsratio;
RANDOM INTERCEPT / subject=hospital_number type=VC solution CL;
COVTEST /WALD;
ods output parameterestimates=parms1 solutionr=rand_parms1;
run;

proc sort data=parms1;
by _imputation_;
run;

proc mianalyze parms=parms1;
modeleffects intercept ;
run;

proc sort data=rand_parms1;
by subject  _imputation_;
run;

proc mianalyze parms=rand_parms1(rename=(stderrpred=stderr));
modeleffects intercept;
by subject ;
run;


*MODEL 2 ADDING IN PATIENT LEVEL DEMOGRAPHICS;
proc glimmix data = mi_fcs;
by _imputation_; 
 class hospital_number  insurance (ref = '0') sex  ethnicity (ref = '2') race (ref = '1');
 model opioid (event = '1') = sex race ethnicity insurance / CL dist=bianary link=logit solution ODDSRATIO;
 random intercept  / subject=hospital_number solution CL ;
 COVTEST / WALD;
ods output parameterestimates=parms2 solutionr=rand_parms2;
run; 

proc sort data=parms2;
by _imputation_;
run;

proc mianalyze parms=parms2;
class sex race ethnicity insurance;
modeleffects intercept sex race ethnicity insurance;
run;

proc sort data=rand_parms2;
by subject  _imputation_;
run;

proc mianalyze parms=rand_parms2(rename=(stderrpred=stderr));
modeleffects intercept;
by subject ;
run;



*MODEL 3 ADDING IN HOSPITAL REGION;
proc glimmix data = mi_fcs;
by _imputation_; 
 class hospital_number  insurance (ref = '0') sex region (ref = '3') ethnicity (ref = '2') race (ref = '1');
 model opioid (event = '1') = sex race ethnicity insurance region   / CL dist=binary link=logit solution ODDSRATIO ;
 random intercept  / subject=hospital_number type=VC solution CL ;
 COVTEST / WALD;
ods output parameterestimates=parms3 solutionr=rand_parms3;
run; 

data parms3b;
set parms3;
if _Imputation_ = 1 then delete; 
run;

proc sort data=parms3;
by _imputation_;
run;

proc mianalyze parms (classvar=full) =parms3;
class sex race ethnicity insurance region;
modeleffects intercept sex race ethnicity insurance region;
run;

proc sort data=rand_parms3;
by subject  _imputation_;
run;

proc mianalyze parms=rand_parms3(rename=(stderrpred=stderr));
modeleffects intercept;
by subject ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm relatively new to using SAS, but everything seems to be working up to the third model where I add in the variable "region." The model runs, however it fails to converge on imputation #4, #10, #19, #21, and #25.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to combine the parameter estimates following the model, I get the below message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;600  proc mianalyze parms (classvar=full) =parms3;
601  class sex race ethnicity insurance region;
602  modeleffects intercept sex race ethnicity insurance region;
603  run;

ERROR: Within-imputation observations not found for _Imputation_= 4 in the input PARMS= data set.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unfamiliar with how to go about troubleshooting this, is it best to tackle the convergence issue or is there a method for dropping the imputations that did not converge from the parameter estimates that are being fed into the mi analyze procedure?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if there's additional information that I should include in this post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 16:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mianalyze-parms-with-GLIMMIX-model/m-p/610880#M29572</guid>
      <dc:creator>Shad</dc:creator>
      <dc:date>2019-12-11T16:15:07Z</dc:date>
    </item>
  </channel>
</rss>

