BookmarkSubscribeRSS Feed
alfa95
Calcite | Level 5

Dear all,

I am doing PROC MI to impute data under MNAR.
My data is a continuous response with 7 repeated measurement, a continuous covariate with 7 repeated measurement, and a categorical covariate with 7 repeated measurement.)

 

  proc mi data=monotonized seed=123 out=mnar_imputedXYZ simple nimpute=5 round=0.01 minimum=0;
  CLASS Z_1 Z_2 Z_3 Z_4 Z_5 Z_6 Z_7;
	  VAR  y1 X_1 Z_1 y2 X_2 Z_2 y3 X_3 Z_3 y4 X_4 Z_4 
	y5 X_5 Z_5 y6 X_6 Z_6 y7 X_7  Z_7           ;
  monotone reg;
  monotone discrim(Z_1= y1 X_1   y2 X_2   y3 X_3   y4 X_4   
	y5 X_5   y6 X_6   y7 X_7  /classeffects=include);
  monotone discrim(Z_2=  y1 X_1  y2 X_2   y3 X_3   y4 X_4   
	y5 X_5   y6 X_6   y7 X_7  /classeffects=include);
  monotone discrim(Z_3=  y1 X_1 Z_1 y2 X_2 Z_2 y3 X_3 y4 X_4  
	y5 X_5   y6 X_6   y7 X_7  /classeffects=include);
  monotone discrim(Z_4=  y1 X_1 Z_1 y2 X_2 Z_2 y3 X_3 Z_3 y4
X_4  y5 X_5   y6 X_6   y7 X_7  /classeffects=include);
  monotone discrim(Z_5=  y1 X_1 Z_1 y2 X_2 Z_2 y3 X_3 Z_3 
y4 X_4 Z_4 y5 X_5   y6 X_6   y7 X_7  /classeffects=include);
  monotone discrim(Z_6= y1 X_1 Z_1 y2 X_2 Z_2 y3 X_3 Z_3 y4 X_4 Z_4 
	y5 X_5 Z_5 y6 X_6   y7 X_7  /classeffects=include);
  monotone discrim(Z_7= y1 X_1 Z_1 y2 X_2 Z_2 y3 X_3 Z_3 y4 X_4 Z_4 
	y5 X_5 Z_5 y6 X_6 Z_6 y7 X_7  /classeffects=include);
 mnar model( y1 y2 y3 y4 y5
  y6 y7 X_1 X_2 X_3 X_4 X_5 X_6 X_7
Z_1 Z_2 Z_3 Z_4 Z_5 Z_6 Z_7/modelobs=ncmv);
  run;

log messages:

 

ERROR: The covariate Y2 is not in the VAR statement.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MNAR_IMPUTEDXYZ may be incomplete. When this step was stopped there
were 0 observations and 0 variables.
WARNING: Data set WORK.MNAR_IMPUTEDXYZ was not replaced because this step was stopped.

 

Also, I put covariates under VAR statement in the order that I put the complete columns first to the columns with least observations.

order 1order 1

I also tried to write the VAR with order as follows, given that my data is repeated measurement with 7-time points and missingness occur in both predictor and response :

order 2order 2
Both order types giving me errors such as " ERROR: The covariate "X" is not in the VAR statement" or "ERROR: The monotone  statement cannot be applied to a nonmonotone data"
My questions are:
1) which correct order of variable I should put in VAR statement? order 1 or order 2?
2) how to solve the error of "covariate X not in the VAR statement" although it is already in the VAR statement?

Thank you for any help

3 REPLIES 3
ballardw
Super User

Please show the code submitted along with the error generated. Copy the proc and messages from the Log and paste into a code box opened on the forum using the {i} or "running man" icon.

alfa95
Calcite | Level 5

@ballardw Hello, thank you for the suggestion, I edited by including the code already

SAS_Rob
SAS Employee

The ordering of the variables on the VAR statement effects the way in which the imputation models are configured because of the montonicity.  It assumes that the variables are listed such that they exhibit a monotone missing pattern from left to right.  In other words, the left-most variable has no missing values, the second has fewer then the third and so on.  This means that the imputation models are built such that only a variable that is to the left of a given variable may be used in its imputation model

 

Specifically there is a problem with this MONOTONE statement:

monotone discrim(Z_1= y1 X_1   y2 X_2   y3 X_3   y4 X_4           y5 X_5   y6 X_6   y7 X_7  /classeffects=include);

 

Since y2 (and several others) comes in the VAR list after Z_1 then it cannot be used as a covariate.  Only those variables listed to the left of Z_1 on the VAR statement could be used.  If you want to use models that include other variables then you will need to relax the monotone assumption and use the FCS approach instead.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 838 views
  • 0 likes
  • 3 in conversation