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.
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
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
I am not sure, but I don't think proc print can output the parameters to a dataset.
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
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.
Thank you. EJ gave the correct answer.
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;
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
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
Thanks. There is no variable named b0 in the output. b0 b1 ... are variables listed under variable parameter. EJ gave the correct answer.
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!
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.