BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MonsieurMo
Calcite | Level 5

s variables,
Hi,

I've built logistic regression models in SPSS previously. In SPSS I had access to CHAID, so I could split my continuous variables in to a number of categorical variables using chi squared test that calculates the optimum splits based on the response variable.

Unfortunately, I don't have SAS Miner, so I can't get access to CHAID here. I was wondering how you guys would handle a continuous variable, if you need to split it in to a categorical variable and how you are able to split it using an alternative procedure?

Thanks for your help.

Mo

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Why discretize your data?  In a short course at the FDA/ASA Biopharmaceutical section in 2011, Dr. Stephen Senn of the University of Glasgow pointed out that discretization is one of the most common errors requested from statisticians by clients (in this case he was referring to clinicians).  The loss of power and interpretability were primary considerations.  I know this doesn't answer your question, but rather raises a philosophical point.  PROC LOGISTIC can certainly handle continuous independent variables, and if the continuous variable you wish to discretize is the dependent variable, there are a wealth of regression procedures available.  For instance, PROC QUANTREG can provide regression models for various quantiles of the response variable.

Steve Denham

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

Why discretize your data?  In a short course at the FDA/ASA Biopharmaceutical section in 2011, Dr. Stephen Senn of the University of Glasgow pointed out that discretization is one of the most common errors requested from statisticians by clients (in this case he was referring to clinicians).  The loss of power and interpretability were primary considerations.  I know this doesn't answer your question, but rather raises a philosophical point.  PROC LOGISTIC can certainly handle continuous independent variables, and if the continuous variable you wish to discretize is the dependent variable, there are a wealth of regression procedures available.  For instance, PROC QUANTREG can provide regression models for various quantiles of the response variable.

Steve Denham

MonsieurMo
Calcite | Level 5

Hi Steve,

Thanks for pointing that out, that's great news!

Can I just explain what I am trying to do, so maybe you can helop me find the best way to do it in SAS as a newbie!

I am trying to predict a customers behaviour as a time dependent variable. So the response variable is that a customer is either:

0: Active

1: 1 month before Inactive

2: 2 months before Inactive

3: 3 months before Inactive

4: 4-6 months before Inactive

I am using the following statement :

(Max segment is by definition a categorical variable.)

proc logistic data = churn.ModelDataSet_Training;

class Max_Segment;

model response (ref = '0') = Max_Segment total_turnover Total_PNL Total_Trades Avg_DaysDiff_NextTrade ACCOUNT_VALUE_GBP EOD_CASH_BALANCE_GBP TOTAL_PAYMENTS_GBP TOTAL_PAYMENTS_IN_GBP TOTAL_PAYMENTS_OUT_GBP Nr_Logins Nr_Devices avg_sessiontime Win_ratio DaysBetweenPaymentsIn DaysBetweenPaymentsOut Max_Consecutive_loss_days Turnover_ratio total_pnl_ratio total_trades_ratio Avg_DDiff_NextTrade_ratio Account_value_ratio Eod_Cash_Balance_ratio Total_Payments_ratio Total_Payments_In_ratio Total_Payments_Out_ratio Nr_Logins_ratio Win_pct_ratio Nr_Devices_Ratio avg_sessiontime_ratio DBetweenPayInRatio DaysBetweenPaymentsOut_ratio max_consec_lossd_ratio

/link = glogit selection = forward itprint maxstep = 100 maxiter = 100 rsquare ;

run;

There may be a better way to fit the predictors to the response, like you say to maybe have a continuous response variable, though I do need to split the Active/Inactive seperately.

I look forward to hearing your expertise!

Thanks

Mo Smiley Happy


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3874 views
  • 0 likes
  • 2 in conversation