BookmarkSubscribeRSS Feed
ACNZ
Calcite | Level 5
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
1 REPLY 1
Olivier
Pyrite | Level 9
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 ;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 568 views
  • 0 likes
  • 2 in conversation