BookmarkSubscribeRSS Feed
Golf
Pyrite | Level 9

Hello,

    Based on the result of the proc reg below.

proc reg   data = example outest=parameters; 
model  y =  A B C D E F;
run;

How can I use SAS to calculate  Obs*Rsquare, instead of using calculator?  

Thank you 

 

 

 

 

4 REPLIES 4
ed_sas_member
Meteorite | Level 14

Hi @Golf 

 

PROC REG assigns a name to each table it creates in the results.

You can retrieve them through the ODS OUTPUT: https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_reg_details52.htm&docsetVersion=1...

 

-> To retrieve the value of the R square (i.e. the % of variability explained by the model), the table name is FITSTATISTICS. Here is the code to be submitted before the PROC REG:

ods output fitstatistics = _fitstatistics;

What do yo mean by "Obs*Rsquare"?

Golf
Pyrite | Level 9
Dear Ed,
Thanks for you response.
Obs*Rsquare is the number of observation multiply to R-square.
If I use "ods output fitstatistics = _fitstatistics", how can I know which symbols are used for the number of observation and the value of R-Square?
Best,
PaigeMiller
Diamond | Level 26

You probably need

 

ods output fitstatistics=fitstatistics nobs=nobs;

as the number of observations used in the regression is in the NOBS table.

 

how can I know which symbols are used for the number of observation and the value of R-Square?

You can know which variables contain the values you want by actually looking at these data sets that are created.

 

I'm skeptical that Obs*Rsquare has any particular meaning in a regression; why do you want this value?

--
Paige Miller
Golf
Pyrite | Level 9
I need obs*R-square to test overidentification based on the method of Sargant test.
Thanks.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1647 views
  • 0 likes
  • 3 in conversation