I am not very familiar with multiple imputation, so I have been reading documentation and familiarizing myself today. I am trying to conduct an ANOVA with multiple imputation.
proc mi DATA=DATASET OUT=OUTIMPUTE1 nimpute=5 SEED=12345;
CLASS AGE SEX;
var Age Sex VAR1 VAR2;
MONOTONE REGRESSION;
run ;
proc glm data=OUTIMPUTE1;
class age SEX VAR1 ;
model VAR2=VAR1 | age | SEX / SOLUTION;
BY IMPUTATION;
ODS output ParameterEstimates=glmparms;
quit;
PROC MIANALYZE PARMS(CLASSVAR=LEVEL)=glmparms;
CLASS VAR1 age SEX;
MODELEFFECTS VAR1 age SEX;
RUN;
"ERROR: Variable VAR1 is not in the PARMS= data set."
Would you please show us (and in the future, always show us when you have an ERROR in the log) the ENTIRE log for these three PROC steps. In other words, we need to see 100% of the log, every single character, showing code as it appears in the log, plus all NOTEs, WARNINGs and ERRORs, with nothing chopped out.
Please copy the log as text and paste it into the "Insert Code" window that opens when you click on the </> icon. DO NOT SKIP THIS STEP.
Sorry about that. Here is the entire log.
proc mi DATA=DATASET OUT=OUTIMPUTE1 nimpute=5 SEED=12345;
305 CLASS AGE SEX;
306 var Age Sex VAR1 VAR2;
307 MONOTONE REGRESSION;
308 run ;
NOTE: The data set WORK.OUTIMPUTE1 has 390 observations and 41 variables.
NOTE: PROCEDURE MI used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
309 proc glm data=OUTIMPUTE1 ;
310 class age SEX VAR1;
311 model VAR2=VAR1| age | SEX / SOLUTION;
312 FORMAT AGE AGE.;
313 FORMAT SEX SEX.;
314 BY _IMPUTATION_;
315 ODS output ParameterEstimates=glmparms;
316 quit;
NOTE: The data set WORK.GLMPARMS has 180 observations and 8 variables.
NOTE: PROCEDURE GLM used (Total process time):
real time 0.07 seconds
cpu time 0.06 seconds
317 PROC MIANALYZE PARMS(CLASSVAR=LEVEL)=GLMPARMS;
318 MODELEFFECTS INTERCEPT VAR1 age SEX;
319 RUN;
ERROR: The model effect VAR1 is not in the 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
While I am not all that familiar with PROC MIANALYZE, the first debugging step is for you to actually look at your data set named GLMPARMS (or run PROC CONTENTS) and see if variable VAR1 is in there.
It is not; however, I am following the SAS documentation almost exactly for a GLM, but I am not using the covariance matrix in that code. Based on what I have seen from other examples, that is not necessary.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.