BookmarkSubscribeRSS Feed
mmjohnson
Calcite | Level 5

Hi,

 

I am trying to run a regression analysis in SAS using proc reg with two sets of variables (second set includes the first set). But I don't want to use selection=stepwise because I don't want any variables discarded based on their contribution. I use SAS 9.4

 

Basically want to first run

model intention = var_a var_b var_c 

 

and then run another model

 

model intention = var_a var_b var_c var_d var_e

 

and see the change in R2, F, significance between the two models.

 

I ran it in SPSS (output attached) and this is what I want to get in SAS too. Thank you.

 

 

 

 

 

 

3 REPLIES 3
SteveDenham
Jade | Level 19

Since PROC REG is interactive, you can include as many model statements as you want.  The only thing you will not get in the output is a likelihood ratio test, but that can be calculated from the Type I sums of squares.  See the following:

 

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_reg_examples...

 

In that example there are only two variables entered into one of the two model statements, and one into the other, but you should be able to easily expand this example to your code.

 

Steve Denham

 

 

mmjohnson
Calcite | Level 5

Thank you, that is helpful. But I was also looking to get a table showing the change in R-squared, F-statistic and p-value between the two models. Do you know where I could find a reference for that option?

 

 

SteveDenham
Jade | Level 19

ODS output statements can put all of the fit statistics into a dataset, and from there you can do about anything.

 

Steve Denham

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1623 views
  • 0 likes
  • 2 in conversation