Help using Base SAS procedures

Pulling AIC/R^2 data out of proc autoreg output

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 105
Accepted Solution

Pulling AIC/R^2 data out of proc autoreg output

Hello guys,

So I am estimating a series of models with PROC Autoreg, and then I'm trying to build a summary table with some statistics/parameter estimates of each estimated model; and so I'd like to be able to add R^2/AIC and the various statistics output from Autoreg into this data table. The issue I'm having is I can only find a way to see these statistics in the Results-SAS Report, and not output as a sas dataset. I'm aware of the method of exporting these SAS-Report tables via "ods output" statement; i.e. to get the Durbin-H statistic into a dataset from the SAS-Report I use:

ods output "Miscellaneous Statistics" = durbinh;


And this works successfully, however when I try the same method for the mentioned statistics via:

ods output "Ordinary Least Squares Estimates" = stat_out;

No dataset is produced, and so I'm not sure why this method won't work for that table inparticular. Am I doing something wrong, or does anyone have any suggestions on how I can accomplish this?

Thank you!!

-Ryan


Accepted Solutions
Solution
‎03-21-2014 01:34 PM
Super User
Posts: 11,343

Re: Pulling AIC/R^2 data out of proc autoreg output

Posted in reply to AllSoEasy

There is in the online documentation a section titled

ODS Table Names and the SAS/ETS Procedures That Produce Them

at least in my 9.2 install that displays the names of the tables and in some cases the specific options that generate the tables in Proc Autoreg.

None of those listed have a description of "ordinary least squares estimates" so anything further I would be guessing.

Run your code with ODS Trace On; before the procedure and Off afterwards to get the table names created by your code.

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Pulling AIC/R^2 data out of proc autoreg output

Posted in reply to AllSoEasy

You want to check the documentation for the names of the tables. It looks like you may be using a title from output and that may not always be an acceptable description.

If you are trying to capture data from the DW= option that you want the DWTest table.

Otherwise you may have to go the ODS trace route to determine which tables are being generated with your code.

Frequent Contributor
Posts: 105

Re: Pulling AIC/R^2 data out of proc autoreg output

Hello ballardw -- Thank you for response. I'm just a bit unclear on what you mean; you're saying the name of the table may not actually be the name printed in the output?

-Also it is not from a dw= option, is a default output table from Autoreg "Ordinary Least Squares Estimates".

Solution
‎03-21-2014 01:34 PM
Super User
Posts: 11,343

Re: Pulling AIC/R^2 data out of proc autoreg output

Posted in reply to AllSoEasy

There is in the online documentation a section titled

ODS Table Names and the SAS/ETS Procedures That Produce Them

at least in my 9.2 install that displays the names of the tables and in some cases the specific options that generate the tables in Proc Autoreg.

None of those listed have a description of "ordinary least squares estimates" so anything further I would be guessing.

Run your code with ODS Trace On; before the procedure and Off afterwards to get the table names created by your code.

Frequent Contributor
Posts: 105

Re: Pulling AIC/R^2 data out of proc autoreg output

Posted in reply to AllSoEasy

Gahhhh that's it! The underlying table was named "Fit Summary".

Many thanks Ballardw!!!!

🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 422 views
  • 3 likes
  • 2 in conversation