BookmarkSubscribeRSS Feed
Kanyange
Fluorite | Level 6

Hi All,

A quick question on ordinal variables..I have entered some ordinal variables and use them in Logistic Regression...but EM treats them as a categorical variables.

The variables I entered were continuous originally and I have binned them (using the median) so they can have a normal distribution shape! So when I enter them in EM as ordinal, the outpout of the Logistic Regression shows them as categorical variables!

Could you please let me know your suggestions?

Many Thanks

2 REPLIES 2
Reeza
Super User

From a 'mechanical' point of view ordinal and categorical are treated the same, the interpretation is different.

BInning to to obtain normal distribution isn't something I'be heard of before, do you have a reference for that?

Kanyange
Fluorite | Level 6

H Reeza,

The binning is a bit manual and is based on median , something like this below...

So the final model looks like the file attached..Obviously something is wrong with the model..What do you think is the problem looking at the lift..?

And the final equation looks like that...the variables have been regrouped by Variable Selection Node, that's why they have a G Prefixe.

Your help would be much appreciated..

Thank you

Parameter DFEstimateStandard ErroraldChi-SquarePr > ChiSqExp(Est)
Intercept 1-7.26410.78884.97<.00010.001
G_bin_aip_mth_03010.21250.00481963.51<.00011.237
G_bin_aip_mth_0311-0.37490.005155297.46<.00010.687
G_bin_aip_mth_0321-0.08660.00307795.05<.00010.917
G_bin_aip_mth_03310.08140.00281841.56<.00011.085
G_bin_prodosales_pfe_54301-0.22610.003673796.88<.00010.798
G_bin_prodosales_pfe_54311-0.05440.00454143.35<.00010.947
G_bin_prodosales_pfe_543210.07120.00357397.86<.00011.074
G_bin_prodosales_pfe_543310.16130.003562052.07<.00011.175
G_bin_prodosales_pfe_543410.18790.003283272.51<.00011.207
G_bin_prodosales_frt_43010.18620.004072088.31<.00011.205
G_bin_prodosales_frt_43110.28960.003915484.97<.00011.336
G_bin_prodosales_frt_43210.26910.004154201.51<.00011.309
G_bin_prodosales_frt_43310.18320.003392928.51<.00011.201
G_bin_prodosales_frt_4341-0.04970.00429134.47<.00010.951
G_bin_prodosales_frt_4351-0.31430.005073839.66<.00010.73
G_bin_trans_34_pen01-0.63390.0026756480.32<.00010.531
G_bin_trans_34_pen110.17990.003093382.14<.00011.197
G_bin_wtr_trans_54_301-0.25240.00374643.1<.00010.777
G_bin_wtr_trans_54_3110.21730.004921948.88<.00011.243
G_bin_units_bst_54301-0.23450.0021511879.58<.00010.791
G_bin_units_bst_543110.11120.002432095.4<.00011.118
G_bin_sales_change01-7.98320.788102.63<.00010

/*Binning to normalize the variable*/

data &init._base_&model._&vers.;

   set &init._base_&model._&vers.;

   if &in_name. = 0 or missing(&in_name.)= 1 then &out_name. = 0;

   else if &in_name. < 0 then &out_name. = -1;

   else if &in_name. < 0.2 * &med. then &out_name. = 1;

   else if &in_name. < 0.6 * &med. then &out_name. = 2;

   else if &in_name. < 0.9 * &med. then &out_name. = 3;

   else if &in_name. < 1.3 * &med. then &out_name. = 4;

   else if &in_name. < 2.0 * &med. then &out_name. = 5;

   else if &in_name. < 2.9 * &med. then &out_name. = 6;

   else if &in_name. < 3.9 * &med. then &out_name. = 7;

   else if &in_name. < 5.0 * &med. then &out_name. = 8;

   else if &in_name. < 6.2 * &med. then &out_name. = 9;

   else &out_name. = 10;

  run;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

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