Help using Base SAS procedures

Proc mianalyze parms error

Reply
Occasional Contributor
Posts: 5

Proc mianalyze parms error

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!

SAS Super FREQ
Posts: 502

Re: Proc mianalyze parms error

Posted in reply to gjenkins3

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.

Occasional Contributor
Posts: 5

Re: Proc mianalyze parms error

Posted in reply to WarrenKuhfeld

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;

SAS Super FREQ
Posts: 502

Re: Proc mianalyze parms error

Posted in reply to gjenkins3

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.

Occasional Contributor
Posts: 5

Re: Proc mianalyze parms error

Posted in reply to WarrenKuhfeld

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

SAS Super FREQ
Posts: 502

Re: Proc mianalyze parms error

Posted in reply to gjenkins3

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.

Ask a Question
Discussion stats
  • 5 replies
  • 325 views
  • 2 likes
  • 2 in conversation