The CATMOD Procedure

Example 32.11 Predicted Probabilities

(View the complete code for this example.)

Suppose you have collected marketing research data to examine the relationship between a prospect’s likelihood of buying your product and the person’s education and income. Specifically, the variables are as follows:

Variable

Levels

Interpretation

Education

high, low

Prospect’s education level

Income

high, low

Prospect’s income level

Purchase

yes, no

Did prospect purchase product?

The following statements first create a data set, loan, that contains the marketing research data. Then the CATMOD procedure fits a model, obtains the parameter estimates, and obtains the predicted probabilities of interest. These statements produce Output 32.11.1 and Output 32.11.2.

data loan;
   input Education $ Income $ Purchase $ wt;
   datalines;
high  high  yes    54
high  high  no     23
high  low   yes    41
high  low   no     12
low   high  yes    35
low   high  no     42
low   low   yes    19
low   low   no      8
;
ods output PredictedValues=Predicted (keep=Education Income PredFunction);
proc catmod data=loan order=data;
   weight wt;
   response marginals;
   model Purchase=Education Income / pred design;
run;
proc sort data=Predicted;
   by descending PredFunction;
run;
proc print data=Predicted;
run;

Notice that the preceding statements use the Output Delivery System (ODS) to output the parameter estimates instead of the OUT= option, though either can be used.

Output 32.11.1: Marketing Research Data: Obtaining Predicted Probabilities

The CATMOD Procedure

Data Summary
ResponsePurchaseResponse Levels2
Weight VariablewtPopulations4
Data SetLOANTotal Frequency234
Frequency Missing0Observations8

Population Profiles
SampleEducationIncomeSample Size
1highhigh77
2highlow53
3lowhigh77
4lowlow27

Response Profiles
ResponsePurchase
1yes
2no

Response Functions and Design Matrix
SampleResponse
Function
Design Matrix
1 2 3
10.70130111
20.7735811-1
30.454551-11
40.703701-1-1

Analysis of Variance
SourceDF Chi-SquarePr > ChiSq
Intercept1418.36<.0001
Education18.850.0029
Income14.700.0302
Residual11.840.1745

Analysis of Weighted Least Squares Estimates
Parameter Estimate Standard
Error
Chi-
Square
Pr > ChiSq
Intercept 0.64810.0317418.36<.0001
Educationhigh0.09240.03118.850.0029
Incomehigh-0.06750.03124.700.0302

Predicted Values for Response Functions
EducationIncomeFunction
Number
ObservedPredictedResidual
FunctionStandard
Error
FunctionStandard
Error
highhigh10.7012990.0521580.672940.0477940.028359
highlow10.7735850.0574870.8080340.051586-0.03445
lowhigh10.4545450.0567440.488110.051077-0.03356
lowlow10.7037040.0878770.6232040.0648670.080499


Output 32.11.2: Predicted Probabilities Data Set

ObsEducationIncomePredFunction
1highlow0.808034
2highhigh0.67294
3lowlow0.623204
4lowhigh0.48811


You can use the predicted values (values of PredFunction in Output 32.11.2) as scores representing the likelihood that a randomly chosen subject from one of these populations will purchase the product. Notice that the "Response Profiles" table in Output 32.11.1 shows you that the first sorted level of Purchase is 'yes', indicating that the predicted probabilities are for Pr(Purchase='yes'). For example, someone with high education and low income has an estimated probability of purchase of 0.808. Like any response function estimate given by PROC CATMOD, this estimate can be obtained by cross-multiplying the row from the design matrix corresponding to the sample (sample number 2 in this case) with the vector of parameter estimates: .

This ranking of scores can help in decision making (for example, with respect to allocation of advertising dollars, choice of advertising media, choice of print media, and so on).