BookmarkSubscribeRSS Feed
lamenramen
Calcite | Level 5
Hi, I am trying to do multiple imputation. I've given it a shot for the entire day, but something is wrong.

I run a macro below. It's just a simple cancer vs abx univariate logistic regression model. What does the warning indicate? I am using PROC MI first (no errors) and then PROC logistic, and then PROC mianalyze.



3980 %univariate_categorical(var1=cancer, var2=cancer);
NOTE: PROC LOGISTIC is modeling the probability that RECEIVED_ABX='1'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=1
NOTE: PROC LOGISTIC is modeling the probability that RECEIVED_ABX='1'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=2
NOTE: PROC LOGISTIC is modeling the probability that RECEIVED_ABX='1'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=3
NOTE: PROC LOGISTIC is modeling the probability that RECEIVED_ABX='1'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=4
NOTE: PROC LOGISTIC is modeling the probability that RECEIVED_ABX='1'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The above message was for the following by-group:
Imputation Number=5
NOTE: The data set WORK.COVBDAT has 10 observations and 4 variables.
NOTE: The data set WORK.PARMSDAT has 10 observations and 7 variables.
NOTE: There were 750 observations read from the data set ABX.PROCESSED150_IMPUTED.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.19 seconds
cpu time 0.18 seconds



WARNING: Between-imputation variance is zero for variable intercept.
WARNING: Between-imputation variance is zero for variable cancer.
NOTE: PROCEDURE MIANALYZE used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds





On a different predictor variable, which is continuous, I get a flat out error:



ERROR: Within-imputation Estimate missing for variable days_cough_duration_numeric in
_Imputation_= 1 in the input PARMS= data set.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MIANALYZE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


I opened up the data set and I don't see any errors in imputation #1.

What is the most painless way to do multiple imputation for categorical variables? I see this IVE software, but I took a look and that looks like another learning curve to learn how to use. I'd prefer to do it in SAS 9.1

Thanks!
3 REPLIES 3
HelloWorld
Calcite | Level 5

I know this question was posted a few years ago, but I ran into the second problem listed here and thought I would post how I solved it in case anyone else runs into it. 

When results are sent to the parameter and covariance data sets, the parameter names in the parameter data set have a set length of 20 characters.  Thus, in the parameter data set your parameter name is being cut off at days_cough_duration_.    In the covariance data set and your MODELEFFECTS statement in PROC MIANALYZE, however, it is still days_cough_duration_numeric, and so the names don't match and SAS thinks it doesn't have the estimates for the variable.  Change the variable name to a shorter one and it solves the problem. 

For the first question, it seems that having between-imputation variance of zero would indicate that there were no differences between the results for the imputed data sets, and thus no differences between the imputed data sets for these variables.  If both variables are dichotomous and you had a good number of predictor variables and few missing, this seems reasonable.  I tried this with my own data, with two dichotomous variables with only 1 missing respondent per variable. The imputed values were the same in each imputation, and when I ran PROC LOGISTIC and then PROC MIANALYZE I got the same warnings you did.

ZanginZeebari
Calcite | Level 5

I had the same problem. When I looked more, the output table of estimates truncated long variable names. Then, with selecting shorter variable names, my problem was solved. I'm not sure if you have the same problem.

Wendi36
Calcite | Level 5

Just rename and create a shorter variable name, and it could be fixed.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 6593 views
  • 5 likes
  • 4 in conversation