Desktop productivity for business analysts and programmers

Extract data from SAS Report

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Extract data from SAS Report

I've conducted a T-Test in Enterprise Guide and it has generated a report with all of the data I need. However, this data is not very useful to me in report form. Is there a way to extract some of the data (a particular table with the p-value) from the SAS Report and make it a queryable data table?

Thanks.


Accepted Solutions
Solution
‎11-10-2011 12:03 PM
Super User
Posts: 19,167

Extract data from SAS Report

Ah yes, the fun with EG.

You can't with EG 4.3 as far as I can see with the GUI interface.

You can with code.

ods table ttest=mytable;

proc ttest data=sashelp.class;

class sex;

var height;

run;

That should create a table called mytable that has the info you want.


In general you can do that for most procs and you can find the table names from the doc or running a proc between ods trace on; SAS CODE; ods trace off;

View solution in original post


All Replies
Super User
Posts: 5,388

Extract data from SAS Report

Sorry, but I don't think that you could get an output table from PROC TTEST (which is the procedure that runs the T-Test task).

It also sends it's out put to ODS Graphics destinations, which can't be pointed to a table.

Maybe there is another procedure that will do this, I don't know since I'm not a statistician.

Linus

Data never sleeps
Solution
‎11-10-2011 12:03 PM
Super User
Posts: 19,167

Extract data from SAS Report

Ah yes, the fun with EG.

You can't with EG 4.3 as far as I can see with the GUI interface.

You can with code.

ods table ttest=mytable;

proc ttest data=sashelp.class;

class sex;

var height;

run;

That should create a table called mytable that has the info you want.


In general you can do that for most procs and you can find the table names from the doc or running a proc between ods trace on; SAS CODE; ods trace off;

SAS Super FREQ
Posts: 8,820

Re: Extract data from SAS Report

If you use PROC TTEST, and ODS TRACE, you will see that the name of the object you want is TTESTS (with an 'S') I do not believe that using just TTEST will work. TRACE information for PROC TTEST is shown below.

cynthia

Output Added:
-------------
Name:       Statistics
Label:      Statistics
Template:   Stat.TTest.Statistics
Path:       Ttest.Height.Statistics
Label Path: 'The Ttest Procedure'.Height.'Statistics'
-------------

            

Output Added:
-------------
Name:       ConfLimits
Label:      Confidence Limits
Template:   Stat.TTest.ConfLimits
Path:       Ttest.Height.ConfLimits
Label Path: 'The Ttest Procedure'.Height.'Confidence Limits'
-------------

              

Output Added:
-------------
Name:       TTests
Label:      T-Tests
Template:   Stat.TTest.TTests
Path:       Ttest.Height.TTests
Label Path: 'The Ttest Procedure'.Height.'T-Tests'
-------------

                    

Output Added:
-------------
Name:       Equality
Label:      Equality of Variances
Template:   Stat.TTest.Equality
Path:       Ttest.Height.Equality
Label Path: 'The Ttest Procedure'.Height.'Equality of Variances'
-------------

        

Occasional Contributor
Posts: 9

Re: Extract data from SAS Report

This is correct Cynthia, and thank you. I appreciate you clearing this up. Before any responses were posted I had managed to dig all of this info up in the help file, so when Reeza posted the information I gave it a only quick glance. When referencing the table you do need "TTests" and not just "TTest"

🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 272 views
  • 3 likes
  • 4 in conversation