BookmarkSubscribeRSS Feed
benji3
Fluorite | Level 6

Hi all, 

 

I'd like some help understanding a WARNING I'm receiving from proc MI when shifting imputations according to some classification variable (i.e. different shifts by different levels of the class variable).

 

My understanding of the code below is that I have called proc MI twice and using the same imputation model (one fit using all the data which depends only on the TRT variable) I have adjusted the MAR imputations by some shift (on the log-odds scale in this case because the model is an ordered logistic model).

 

I do not understand why a WARNING would be given, apparently because the observations selected for adjustment all have a missing outcome value. I think there is a single imputation model. Why does it matter if the adjustments to a selection of observations happen to be unique to variables with a missing outcome? And the imputation appears to still be correctly performed despite the WARNING?

 

Can anyone shed light on this? 

 

Thank you!

 


/*create some data to illustrate the WARNING*/ data dsin; call streaminit(1); do USUBJID=1 to 200; if rand("UNIFORM") gt 0.2 then AVAL = rand("BINOMIAL", 0.5, 2); else AVAL=.; TRT = mod(USUBJID, 2); select; when (TRT=0) do; IMPLEVEL1="IMP0"; IMPLEVEL2="IMP0 "; end; when (AVAL=. and TRT=1) do; IMPLEVEL1="IMP1"; IMPLEVEL2="IMP1a"; end; when (AVAL ne . and TRT=1) do; IMPLEVEL1="IMP1"; IMPLEVEL2="IMP1b"; end; end; output; end; run; /*This imputation shifts log odds of event=2 by 1 in TRT=0 and by 2 in TRT=1 arm compared to an MAR imputation?*/ proc mi data=dsin out=filled1 nimpute=10000; class AVAL TRT IMPLEVEL1; var TRT AVAL; monotone logistic(AVAL = TRT); mnar adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL1="IMP0") shift=1) adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL1="IMP1") shift=2) ; run; /*This imputation does the same thing, I think? but produces a WARNING: WARNING: IMPLEVEL2=IMP1a is not a valid classification level in the ADJUSTOBS= option in the MNAR statement. */ proc mi data=dsin out=filled2 nimpute=10000; class AVAL TRT IMPLEVEL2; var TRT AVAL; monotone logistic(AVAL = TRT); mnar adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL2="IMP0") shift=1) adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL2="IMP1a") shift=2) adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL2="IMP1b") shift=2) /*This is a pointless because there is no missing data with IMPLEVEL2="IMP1b", but leave it here anyway for completeness*/ ; run; proc sort data=filled1; by TRT; run; proc means data=filled1; by TRT; var AVAL; run; proc sort data=filled2; by TRT; run; proc means data=filled2; by TRT; var AVAL; run; /*the imputed data appears identical (on average) so why the WARNING?*/

 

3 REPLIES 3
ballardw
Super User

Suggest running:

proc freq data=dsin;
   tables aval*implevel2;
run;

and examine how many combinations of aval=2 and implevel2='Imp1a'.

 

Hard to impute the result when that combination never occurs in the data.

 


@benji3 wrote:

Hi all, 

 

I'd like some help understanding a WARNING I'm receiving from proc MI when shifting imputations according to some classification variable (i.e. different shifts by different levels of the class variable).

 

My understanding of the code below is that I have called proc MI twice and using the same imputation model (one fit using all the data which depends only on the TRT variable) I have adjusted the MAR imputations by some shift (on the log-odds scale in this case because the model is and ordered logistic model.

 

I do not understand why a WARNING would be given, apparently because the observations selected for adjustment all have a missing outcome value. I think there is a single imputation model. Why does it matter if the adjustments to a selection of observations happen to be unique to variables with a missing outcome? And the imputation appears to still be correctly performed despite the WARNING?

 

Can anyone shed light on this? 

 

Thank you!

 


/*create some data to illustrate the WARNING*/ data dsin; call streaminit(1); do USUBJID=1 to 200; if rand("UNIFORM") gt 0.2 then AVAL = rand("BINOMIAL", 0.5, 2); else AVAL=.; TRT = mod(USUBJID, 2); select; when (TRT=0) do; IMPLEVEL1="IMP0"; IMPLEVEL2="IMP0 "; end; when (AVAL=. and TRT=1) do; IMPLEVEL1="IMP1"; IMPLEVEL2="IMP1a"; end; when (AVAL ne . and TRT=1) do; IMPLEVEL1="IMP1"; IMPLEVEL2="IMP1b"; end; end; output; end; run; /*This imputation shifts log odds of event=2 by 1 in TRT=0 and by 2 in TRT=1 arm compared to an MAR imputation?*/ proc mi data=dsin out=filled1 nimpute=10000; class AVAL TRT IMPLEVEL1; var TRT AVAL; monotone logistic(AVAL = TRT); mnar adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL1="IMP0") shift=1) adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL1="IMP1") shift=2) ; run; /*This imputation does the same thing, I think? but produces a WARNING: WARNING: IMPLEVEL2=IMP1a is not a valid classification level in the ADJUSTOBS= option in the MNAR statement. */ proc mi data=dsin out=filled2 nimpute=10000; class AVAL TRT IMPLEVEL2; var TRT AVAL; monotone logistic(AVAL = TRT); mnar adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL2="IMP0") shift=1) adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL2="IMP1a") shift=2) adjust(AVAL(event="2") / ADJUSTOBS= (IMPLEVEL2="IMP1b") shift=2) /*This is a pointless because there is no missing data with IMPLEVEL2="IMP1b", but leave it here anyway for completeness*/ ; run; proc sort data=filled1; by TRT; run; proc means data=filled1; by TRT; var AVAL; run; proc sort data=filled2; by TRT; run; proc means data=filled2; by TRT; var AVAL; run; /*the imputed data appears identical (on average) so why the WARNING?*/

 


 

benji3
Fluorite | Level 6
Hi balladw,
I know that AVAL is always missing when IMPLEVEL2=IMP1a. I deliberately constructed the data in that way. However I am fitting (or trying to fit) a single imputation model, estimated from the entire dataset and to adjust subsets of those imputations. I am not trying to fit separate imputation models as I think you're implying?
Also note that the imputation+shift adjustment is performed for this IMP1a level, (and I think correctly performed). I'm trying to understand the reason for the WARNING.
Thanks,
Ben
benji3
Fluorite | Level 6
Hi balladw,
I know that AVAL is always missing when IMPLEVEL2=IMP1a. I deliberately
constructed the data in that way. However I am fitting (or trying to fit) a
single imputation model, estimated from the entire dataset and to adjust
subsets of those imputations. I am not trying to fit separate imputation
models as I think you're implying?
Also note that the imputation+shift adjustment is performed for this IMP1a
level, (and I think correctly performed). I'm trying to understand the
reason for the WARNING.
Thanks,
Ben

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 918 views
  • 1 like
  • 2 in conversation