SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Jonate_H
Quartz | Level 8

What option will help the following PROC GLM to also report adjusted R-squared? thanks!

PROC GLM DATA=have ;

ABSORB year;

MODEL y = a b c /solution noint ;

RUN;

QUIT;

9 REPLIES 9
mohamed_zaki
Barite | Level 11

I do not think there is such option why do not you use PROC RSQUARE

Jonate_H
Quartz | Level 8

Thank you Mohamed!

SteveDenham
Jade | Level 19

A couple of points: R squared and adjusted R squared are oddly defined with models without intercepts.  Still, you could plug the R-squared value obtained from GLM into the formula for adjusted R squared (no intercept):

ADJRSQ(no int) = 1 - n * (1 - R^2)/(n - p), where n is the number of observations and p is the number of parameters fit.

Steve Denham

Jonate_H
Quartz | Level 8

Thank you Steve! that's very helpful.

H
Pyrite | Level 9 H
Pyrite | Level 9

Steve et al.,

It was not clear to me if the model the R^2 value came from had to have any type of option in regards to the intercept or not. Do I run a normal proc glm when getting the R^2 value for the calculation. Also, do you know the name of this particular R^2 adjustment?

Thanks!

H
Pyrite | Level 9 H
Pyrite | Level 9

I didn't see a "-1" in the df line, so I am guessing the "noint" option needs to be used with the proc glm statement that generates the R^2, correct?

H
Pyrite | Level 9 H
Pyrite | Level 9

Sidenote, I get this in my Log:

"NOTE: Due to the presence of CLASS variables, an intercept is implicitly fitted. R-Square has

been corrected for the mean."


SteveDenham
Jade | Level 19

The formula I gave for the adjusted R^2 is just the standard adjustment, except that the n-1 in the numerator and denominator is replaced by n, since the intercept is not estimated.  I don't remember where I found that, but Draper and Smith would be a good place to start. It needs to be the value obtained with the noint option, for it to be consistent.  It is a measure of the association between the response and the X values, both considered as deviations from zero, rather than deviations from the mean.

Steve Denham


KALLEN
Obsidian | Level 7

Is p the number of parameters including or excluding the intercept?

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 9 replies
  • 18021 views
  • 5 likes
  • 5 in conversation