BookmarkSubscribeRSS Feed
gjenkins3
Fluorite | Level 6

Hello!

 

I'm using SAS university edition/studio. I'm trying to run multiple imputations on a dataset and cannot get past the following error message:

 

'ERROR: Variable _Imputation_ is not in the PARMS= data set.'

 

Here's the code I'm using:

 

proc mi data=transformed nimpute=20 out=TransformedMI;
var year logddq_fri logddq_sat od_ecig02 od_ecstasy13 od_halluc09 od_oth14;
run;


proc glm data=transformedMI;
class year;
model logddq_fri logddq_sat = year;
run;
quit;
ods output parameterestimates=ParmEst;
run;
quit;

 

proc mianalyze parms=ParmEst;
modeleffects logddq_fri logddq_sat year;
run;

 

If I look at the contents of ParmEst, there certainly is no _imputation_ variable in it. I've tried many variations of the code, and consulted many websites/tutorials, but just can't seem to find alterations that resolve this error. Any help would be greatly appreciated!

6 REPLIES 6
WarrenKuhfeld
Rhodochrosite | Level 12

Certainly this is wrong.  Remove the first QUIT statement and both RUN statements. (Yes, some other variations are OK too.)

proc glm data=transformedMI;
class year;
model logddq_fri logddq_sat = year;
run;
quit;
ods output parameterestimates=ParmEst;
run;
quit;

Documentation examples show creating a PARMEST data set using a BY variable _Imputation_.  You need such a BY variable.  There might or might not be other things wrong, but that is what jumped out at me.

gjenkins3
Fluorite | Level 6

I appreciate your response. Unfortunately, the multiple 'run' and 'quit' commands are the only way I've been able to create the ods output parameter estimates. If I remove them, it gives me an entirely separate error saying that the output wasn't created. I've also included a BY _imputation_ statement, as seen below, but it still returns ERROR: Variable _Imputation_ is not in the PARMS= data set.

 

proc glm data=transformedMI;
class year;
model logddq_fri logddq_sat = year;
by _imputation_;
run;
quit;
ods output parameterestimates=ParmEst;

run;
quit;

 


proc mianalyze parms=ParmEst;
modeleffects logddq_fri logddq_sat year;
run;

WarrenKuhfeld
Rhodochrosite | Level 12

I can assure you that you cannot make the ODS output data set after you leave the procedure.  Compare my method and yours with a small example.

proc glm data=sashelp.class;
   class sex;
   model weight = sex height / solution;
   ods output parameterestimates=p;
quit;
   
proc contents varnum data=p; ods select position; run;

proc glm data=sashelp.class;
   class sex;
   model weight = sex height / solution;
run;
quit;
   ods output parameterestimates=p2;
run;
quit;
   
proc contents varnum data=p2; ods select position; run;

You need the SOLUTION option to get the parameter estimates.  You can't just add a BY statement.  The BY variable must the in the input data set.

gjenkins3
Fluorite | Level 6

I appreciate your continuing help. When I make your suggested changes, it does include the variable _Imputation_ in the parameter estimate ods output. However, when I then attempt to run Mianalyze, it provides me with the same error, but for a different variable in my model. It now says:  ERROR: The model effect logddq_fri is not in the PARMS= data set. Proc contents reveals that neither variable logddq_fri, logddq_sat, nor year are in the parameter estimate output file. 

 

Do you have any suggestions as to how to include all the variables in my model statement in the output, so that I can get mianalyze to run?

 

Regards,

 

Garrett

 

Capture.PNG

WarrenKuhfeld
Rhodochrosite | Level 12

Do you really intend to have two dependent variables?  Look at the documentation examples.  They list independent variables not dependent variables on the modeleffects statement.  I am not knowledgeable about this proc.  I was just trying to point out the problems that jumped out at me.

guaguncher
Obsidian | Level 7

Had the same problem where the imputed data indicator on my dataset had another variable name. All I had to was to change that variable name to '_Imputation_' and run Proc mianalyze again. That fixes it. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2550 views
  • 2 likes
  • 3 in conversation