BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
riccardo88
Calcite | Level 5

Hallo everybody,

I am working with a database that looks like this:

data have;                    
input id trt $ var1 $ var2 $;
datalines; 
1 placebo 0.2 3.0
2 placebo 1.1 <1.0
3 drug <0.2 2.0
4 placebo 2.3 .
5 drug <0.2 2.2
6 drug . 1.2
; 

As you can see I have missing values and values that are reported as "below the limit of detection" from the laboratory.

My aim is to use multiple imputation to impute ONLY the values under the limit of detection and not the real missing values.

To do this  I differentiated the two "kinds" of missing values like this:

data have; set have;
		if var1='' then var1_n=.a;
	else if var1 ne '' then var1_n = input(var1, 8.);
	if var1_n=. then var1_n=.b;

		if var2='' then var2_n=.a;
	else if var2 ne '' then var2_n = input(var2, 8.);
	if var2_n=. then var2_n=.b;

	drop var1 var2;
run;

Now A are real missing values and B are values below detection limit.

 

My questions are:

1) Is it possible to use proc mi specifing that I want to impute only the missing values specified with B and not all missing values?

2) Is there an option in proc mi to specify that the imputed values should be between 0 and the limit of detection (for example for var1 between 0 and 0.2)?

 

Thank you very much for your help!

 

SAS Version: 9.4

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

1) Is it possible to use proc mi specifing that I want to impute only the missing values specified with B and not all missing values?

 

Yes. The though process would be a bit different than state: Where the value is not .A. You can use a data step option : data=have (where=(var1_n ne .A)).

Since you have two (or possibly more variables) that would involve a separate imputation step for each variable individually since the subset of records is different for each Variable.

 

2) Is there an option in proc mi to specify that the imputed values should be between 0 and the limit of detection (for example for var1 between 0 and 0.2)?

 

The Proc MI statement options MINIMUM= and MAXIMUM= set the limits on imputed values.

 

View solution in original post

1 REPLY 1
ballardw
Super User

1) Is it possible to use proc mi specifing that I want to impute only the missing values specified with B and not all missing values?

 

Yes. The though process would be a bit different than state: Where the value is not .A. You can use a data step option : data=have (where=(var1_n ne .A)).

Since you have two (or possibly more variables) that would involve a separate imputation step for each variable individually since the subset of records is different for each Variable.

 

2) Is there an option in proc mi to specify that the imputed values should be between 0 and the limit of detection (for example for var1 between 0 and 0.2)?

 

The Proc MI statement options MINIMUM= and MAXIMUM= set the limits on imputed values.

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1 reply
  • 1346 views
  • 0 likes
  • 2 in conversation