BookmarkSubscribeRSS Feed
lionking19063
Fluorite | Level 6

Assuming there is existence of multicollinearity effect of an importance variable(X1) in a logistic regression model, I would like to find out how the performance of model will change if these correlated variables are removed one by one. Because I found X1 has opposite sign in the final model compared to bivariate  model(). I would like to find the variable(s) causing the sign flipped. Here are the details,

  • Run proc corr and sort the correlation coefficients with X1 from high to low
  • Loop over a set of variables in a logistic regression by reducing the one variable each time

 

For example,

1) with X1

Variable

Coefficient

x2

0.6

x3

0.5

x4

0.4

 

2)

Proc logistic data= data desc;

Model y= x1 x4 x3 x2;

Run;

 

Proc logistic data=data desc ;

Model y=x1 x4 x3;

Run;

 

Proc logistic data=data desc ;

Model y= x1 x4;

Run;

 

Does anyone know how to convert logistic regression process in an automatic way? Thanks a lot.

3 REPLIES 3
PaigeMiller
Diamond | Level 26

So you wouldn't ever look at a model that is just X4 as a predictor?

 

model X1=X4;

PROC LOGISTIC does give you the ability to perform "best subset selection" which may be a slightly better method than your looping, and certainly is less coding. You could use the option METHOD=SCORE in the model statement to get this.

 

 

--
Paige Miller

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
  • 1003 views
  • 2 likes
  • 4 in conversation