BookmarkSubscribeRSS Feed
Shad
Obsidian | Level 7

Hello,

 

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). 

 

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. 

 

*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;

 



*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;

 

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. 

 

When I try to combine the parameter estimates following the model, I get the below message. 

 

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.

 

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? 

 

Let me know if there's additional information that I should include in this post. 

 

Thank you! 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 0 replies
  • 1036 views
  • 0 likes
  • 1 in conversation