Help using Base SAS procedures

Is it possible to output only certain parameters in proc model procedure

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 122
Accepted Solution

Is it possible to output only certain parameters in proc model procedure

Hi,

I have a gmm model, and I estimated 16 parameters. I only care about the intercept. Is it possible to output only one parameter in stead of all. I have the following code.

ods output parameterestimates=final;

proc model data = current;

  endo Mean;

  exog x1 x2 x3 x4 x11 x12 x13 x14 x15;

  instruments _exog_;

  parms b0 b1 b2 b3 b4 b11 b12 b13 b14 b15;

  Mean=b0+b1*x1+b2*x2+b3*x3+b4*x4+b11*x11+b12*x12+b13*x13+b14*x14+b15*x15;

  fit Mean/ gmm kernel=(bart,4,0) vardef=n;

run;

quit;

I only want b0 to be presented.


Accepted Solutions
Solution
‎07-18-2013 10:51 AM
Super Contributor
Posts: 333

Re: Is it possible to output only certain parameters in proc model procedure

I believe in the ods statement it would be a where statement similar to the proc print mentioned above:

ods output parameterestimates=final (where=(parameter='b0');


EJ

View solution in original post


All Replies
Respected Advisor
Posts: 2,655

Re: Is it possible to output only certain parameters in proc model procedure

Since you are outputting the parameter estimates to  the dataset final, could you just use PROC PRINT with a WHERE parameter='b0'; statement.  You could suppress the listing for proc model with ods listing close; and just output the estimate, standard error, etc. as needed.

Steve Denham

Frequent Contributor
Posts: 122

Re: Is it possible to output only certain parameters in proc model procedure

I am not sure, but I don't think proc print can output the parameters to a dataset.

Respected Advisor
Posts: 2,655

Re: Is it possible to output only certain parameters in proc model procedure

Sorry.  My statement was very unclear.  My problem was with the ODS statements.  I solved them using ODS HTML rather than ODS LISTING.  I was able to output only the values in the 'final' dataset, and suppress all of the output from PROC MODEL.

Steve Denham

Super Contributor
Posts: 339

Re: Is it possible to output only certain parameters in proc model procedure

cycling through proc model documentation, it supports the keep statement

So you could add

keep b0;

right before run; to achieve the desired result. At least according to documentation.

Frequent Contributor
Posts: 122

Re: Is it possible to output only certain parameters in proc model procedure

Thank you. EJ gave the correct answer.

Super User
Posts: 17,760

Re: Is it possible to output only certain parameters in proc model procedure

Add a keep in with your ODS statement, I don't know what the variable is actually called so make sure you have the correct name:

ods output parameterestimates=final (keep=b0);

proc model data = current;

  endo Mean;

  exog x1 x2 x3 x4 x11 x12 x13 x14 x15;

  instruments _exog_;

  parms b0 b1 b2 b3 b4 b11 b12 b13 b14 b15;

  Mean=b0+b1*x1+b2*x2+b3*x3+b4*x4+b11*x11+b12*x12+b13*x13+b14*x14+b15*x15;

  fit Mean/ gmm kernel=(bart,4,0) vardef=n;

run;

quit;

Solution
‎07-18-2013 10:51 AM
Super Contributor
Posts: 333

Re: Is it possible to output only certain parameters in proc model procedure

I believe in the ods statement it would be a where statement similar to the proc print mentioned above:

ods output parameterestimates=final (where=(parameter='b0');


EJ

Respected Advisor
Posts: 2,655

Re: Is it possible to output only certain parameters in proc model procedure

This last works for me.  I have problems with ods listing close or ods exclude all in ETS, the former not doing anything, and the latter not allowing print when a subsequent procedure (PROC PRINT) is used.

Steve Denham

Frequent Contributor
Posts: 122

Re: Is it possible to output only certain parameters in proc model procedure

Thanks. There is no variable named b0 in the output. b0 b1 ... are variables listed under variable parameter. EJ gave the correct answer.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 294 views
  • 3 likes
  • 5 in conversation