How to: |
Binary logistic regression finds the best linear separation between two classes in the space spanned by the predictors. The target variable has two values (0 and 1), corresponding to the two classes. The predicted value is either a class assignment (0 or 1) or the probability of belonging to class 1.
BLR_CLASSIFY(options, proba_flag, predictor_field1[, predictor_field2, ...] target_field)
where:
Reserved for future use.
Keyword
Indicates whether to display probabilities. Valid values are PROBA, to display the probability of belonging to class 1, and NO_PROBA, to display class assignment.
Numeric
Are one or more predictor field names.
Numeric
Is the target field.
The DEFINE FILE command in the following request creates two education levels, doctorate level (value 1) and no college education (value 0). It also creates other virtual fields with numeric formats that can be used by the function. The TABLE request uses BLR_CLASSIFY to compute the probability that the education level belongs to class 1, doctorate level education, using predictors age, income, population range, and gender.
DEFINE FILE WF_RETAIL BINARY_EDUC_LEVEL/I2 = DECODE WF_RETAIL_EDUCATION_CUSTOMER.EDUCATION_DEGREE_TYPE ( 'Professional Doctorates' 1, 'Doctorates' 1, 'High School' 0, 'No High School' 0, ELSE -1 ); POP_CODE/I2 = DECODE WF_RETAIL_GEOGRAPHY_CUSTOMER.CITY_POPULATION_RANGE ( 'H: 100,001 - 250,000' 1, 'I: 250,001 - 1,000,000' 2, 'J: 1,000,001 - 10,000,000' 3, 'K: 10,000,001 - 50,000,000' 4, ELSE 0 ); GENDER_CODE/I2 = DECODE WF_RETAIL_CUSTOMER.GENDER ( 'M' 1, 'F' 0 ); END
TABLE FILE WF_RETAIL
PRINT
ID_CUSTOMER
BINARY_EDUC_LEVEL
COMPUTE PREDICTED_PROB/D6.4=BLR_CLASSIFY(' ',PROBA,
AGE,
INCOME,
POP_CODE,
GENDER_CODE,
BINARY_EDUC_LEVEL);
WHERE BINARY_EDUC_LEVEL NE -1
WHERE POP_CODE NE 0
WHERE INCOME GT 12001.00
WHERE OUTPUTLIMIT EQ 12
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF,$
ENDSTYLE
END
The partial output is shown in the following image.
WebFOCUS | |
Feedback |