BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I am new to this forum, had hard time figuring out how this could be done in SAS.

The code I am trying to run, regression analysis looks something like this:

Proc reg data = work.temp;
Model &Pred_var = &independent_var / stb tol vif Collin;
By segment;
Run;

I want to run a regression model such that it produces VIF values for each of the by Groups and checks the value of VIF.

Based on the value of VIF I should be able to Print if the regression model has collinearity(VIF > =5) or not(VIF <5).

And if there is collinearity then I should be able to give a rough idea of which variables might be correlated.

Your suggestions would be highly appreciated.

Thank you,

L.
2 REPLIES 2
Paige
Quartz | Level 8
You would have to write some macro code to pick out which by groups have VIF>=5 and then print only those. You can capture the VIF output into a SAS data set using ODS OUTPUT statements.

To get some idea of which variables might be correlated, I would use Principal Components Analysis on the independent variables.
deleted_user
Not applicable
Thank you so much for the reply .. ODS output works well !!

Next step I'll be proceeding with the variables that are correlated ...

again thanks,

L

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 2 replies
  • 1340 views
  • 0 likes
  • 2 in conversation