turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- BI
- /
- Enterprise Guide
- /
- How do I extract t-stats then divide by number of ...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-05-2006 04:37 PM

For a simple regression on one explanatory variable i want to extract the t-stat on this variable and then divide this by the number of observations used in the regression. I need to do this for a number of regressions so i want to be able to write the commands rather than do it by hand.

Thanks

Thanks

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ACNZ

12-07-2006 11:51 AM

When programming, you should use ODS OUTPUT statements to store informations displayed by your regression task into SAS datasets, so that you can re-use them to compute ratios or anything else.

Assuming that you're using PROC REG as a regression program (check the log in your task, or the generated code, if you have any doubt), that would mean doing something like :

ODS OUTPUT nObs = work.obs_number

(WHERE = (label = "Number of Observations Used"))

parameterEstimates = work.tstats ;

/* here just copy and paste the PROC REG code built by your Enterprise Guide task */

DATA work.t ;

MERGE work.tstats

work.obs_number (KEEP = NobsUsed) ;

ratio = tValue / NobsUsed ;

RUN ;

PROC PRINT DATA = work.t LABEL ;

RUN ;

Assuming that you're using PROC REG as a regression program (check the log in your task, or the generated code, if you have any doubt), that would mean doing something like :

ODS OUTPUT nObs = work.obs_number

(WHERE = (label = "Number of Observations Used"))

parameterEstimates = work.tstats ;

/* here just copy and paste the PROC REG code built by your Enterprise Guide task */

DATA work.t ;

MERGE work.tstats

work.obs_number (KEEP = NobsUsed) ;

ratio = tValue / NobsUsed ;

RUN ;

PROC PRINT DATA = work.t LABEL ;

RUN ;