BookmarkSubscribeRSS Feed
Kpianist
Fluorite | Level 6

Hello,

 

I am trying to impute missing data that is based off a scale that ranges from 1 to 25 for 11 of the variables and 0 to 25 for 2 of the variables but I get an error message: 

ERROR: An imputed variable value is not in the specified range after 100 tries.

 The imputed data ranges from -8 to 33.

 

Here is my code: 

PROC MI data=ie out=ie_mi seed=12345 nimpute=10
		/*Set a minimum and maximum for the imputed variables*/
	minimum = 1 1 1 1 1 1 1 1 1 1 1 0 0
	maximum = 25 25 25 25 25 25 25 25 25 25 25 25 25;

	var pbs4_pre pbs8_pre pbs16_pre pbs17_pre pbs18_pre pbs22_pre 
	pbs23_pre pbs27_pre nbs13_pre nbs15_pre nbs19_pre sps4_pre sps5_pre;


RUN;

This is the error:

262 PROC MI data=ie out=ie_mi seed=12345 nimpute=10
263 /*Set a minimum and maximum for the imputed variables*/
264 minimum = 1 1 1 1 1 1 1 1 1 1 1 0 0
265 maximum = 25 25 25 25 25 25 25 25 25 25 25 25 25;
266
267 var pbs4_pre pbs8_pre pbs16_pre pbs17_pre pbs18_pre pbs22_pre
268 pbs23_pre pbs27_pre nbs13_pre nbs15_pre nbs19_pre sps4_pre sps5_pre;
269
270
271 RUN;

NOTE: The EM algorithm (MLE) converges in 150 iterations.
NOTE: The EM algorithm (posterior mode) converges in 47 iterations.
ERROR: An imputed variable value is not in the specified range after 100 tries.
NOTE: The SAS System stopped processing this step because of errors.

 

 Thank you!

5 REPLIES 5
PGStats
Opal | Level 21

For others to look at. The log lines are:

 

262 PROC MI data=ie out=ie_mi seed=12345 nimpute=10
263 /*Set a minimum and maximum for the imputed variables*/
264 minimum = 1 1 1 1 1 1 1 1 1 1 1 0 0
265 maximum = 25 25 25 25 25 25 25 25 25 25 25 25 25;
266
267 var pbs4_pre pbs8_pre pbs16_pre pbs17_pre pbs18_pre pbs22_pre
268 pbs23_pre pbs27_pre nbs13_pre nbs15_pre nbs19_pre sps4_pre sps5_pre;
269
270
271 RUN;
NOTE: The EM algorithm (MLE) converges in 150 iterations.
NOTE: The EM algorithm (posterior mode) converges in 47 iterations.
ERROR: An imputed variable value is not in the specified range after 100 tries.
NOTE: The SAS System stopped processing this step because of errors
PG
ballardw
Super User

@SAS_Rob wrote:

Try the suggestions in this note...

http://support.sas.com/techsup/notes/v8/24/475.html 

 

 


@SAS_Rob

 

The cited page gets a "Page unavailable" message, at least for me.

SAS_Rob
SAS Employee

Perhaps you had an extra space or something in there, but the text from the note is below.

Usage Note 24475: What causes the error, "An imputed variable value is not in the specified range after 100 tries," and how can I fix it?

 

Multiple imputation deals with random draws from the posterior distribution of the variables. When you impose the MIN= and MAX= options, you restrict the possible values that can be drawn. If PROC MI draws a value outside the range, it will attempt to draw another. If this continues 100 times, it aborts the process and issues this error message. Beginning in SAS 9, you can specify the MINMAXITER= option to increase the number of attempts, although in practice this rarely works.

There are a number of other options to try as well when this occurs. You could change the imputation method, try specifying your own prior distribution, or remove the MIN= and MAX= options. If you remove the MIN= and MAX= options, you could then impose those restrictions in a DATA step after performing multiple imputations. This process might require some trial and error and is highly data dependent.

Kpianist
Fluorite | Level 6

Hello,

 

Could you specify what you mean by imposing a restriction on your dataset? Also, could you give an example?

 

Thank you,
Julia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 9115 views
  • 0 likes
  • 4 in conversation