//
//Logit regrassion command
//
//Syntax
logit [target] by [explanations];
//(caution) target and explanation variables must be numeric type;
//
//Example 1 is to rank credit customer by thir property.
//All customer have status + or - which means good or bad.
//
get credit.csv@;
//Rank variables according sensitivity for target variable 'status' by aic analysis
aic status by sex span a4-7 rate a9 a10 a12 a13 jobcode debt amount;
//Variables must be numeric for logit regression.
//Trancerate letter code to numeric value.
if(status == "+") {
flag=1;
}
else {
flag=0;
}
//Remove deficit value
if(old == ? or debt == ?) {
delrec;
}
//Execute logit regression;
logit flag by old span rate amount debt;
//Below is output which is sorted by high probability 'pd'.
//View effeciency of logit analysis.
plot line logitRate by countRate;
//Convert category to numerical to add high rank variables 'a9' 'jobcode' 'a10'.
if(a9 == "f") {
a9f=0;
}
else {
a9f=1;
}
if(jobcode == "0" or jobcode == "2") {
jobf=0;
}
else {
jobf=1;
}
if(a10 == "f") {
a10f=0;
}
else {
a10f=1;
}
//Add high rank variables 'a9f' 'a10f' 'jobf'.
logit flag by old span rate amount debt a9f a10f jobf;
//Compare effeciency plot with old one.
get freq@ana;
over line logitRate by countRate;