The logisticAssociation action computes indices of rank correlation between predicted probabilities and observed responses, which are used for assessing the predictive ability of a model. This action requires a saved model from the logistic action.
| Parameter | Description |
|---|---|
| accuracy | Includes and names the accuracy in the classification table. |
| allStats | When set to True, requests all available statistics. |
| association | When set to True, creates the association table. |
| binEps | Specifies the precision of the predicted probabilities that are used for classification. Default: 1E-05. |
| casOut | Specifies the settings for an output table to store assessment results. |
| ctable | Creates the classification table. |
| cutpt | Specifies cutpoints (probability thresholds) for the classification table. |
| display | Specifies a list of results tables to send to the client for display. |
| fitData | When set to True, specifies that the data to be scored were also used to fit the model. |
| fnf | Includes and names the false negative fraction in the classification table. |
| fpf | Includes and names the false positive fraction (1-specificity) in the classification table. |
| lift | Includes and names the lift in the classification table. |
| misclass | Includes and names the misclassification rate in the classification table. |
| nocounts | When set to True, removes counts from the classification table. |
| npv | Includes and names the negative predictive value in the classification table. |
| outputTables | Lists the names of results tables to save as CAS tables on the server. |
| pc | Includes and names the percent correct in the classification table. |
| ppv | Includes and names the positive predictive value (precision) in the classification table. |
| restore | Specifies the input model store table, which contains the model information saved from the logistic action. |
| table | Specifies the input data table to score and assess. |
| tnf | Includes and names the true negative fraction (specificity) in the classification table. |
| tpf | Includes and names the true positive fraction (recall, sensitivity) in the classification table. |
The following code creates the 'mycas.hmeq' table, which is used in the examples. This dataset contains information about home equity loans.
| 1 | DATA mycas.hmeq; SET sampsio.hmeq; RUN; |
This example first fits a logistic regression model and saves it to a store. Then, it uses the logisticAssociation action to compute and display the model's association statistics.
| 1 | |
| 2 | PROC CAS; |
| 3 | regression.logistic |
| 4 | DATA='hmeq' class={'job','reason'} model={depvar='bad', effects={'job','reason','loan','mortdue','value','yoj','derog','delinq','clage','ninq','clno'}} store={name='myModelStore', replace=true}; |
| 5 | |
| 6 | RUN; |
| 7 | regression.logisticAssociation restore='myModelStore' TABLE='hmeq'; |
| 8 | |
| 9 | RUN; |
| 10 | |
| 11 | QUIT; |
| 12 |
This example extends the basic assessment by generating a classification table. The `ctable=true` parameter produces a table that cross-classifies observations based on whether the predicted event probability is above or below a certain threshold (cutpoint), showing counts of true/false positives and negatives.
| 1 | |
| 2 | PROC CAS; |
| 3 | regression.logistic |
| 4 | DATA='hmeq' class={'job','reason'} model={depvar='bad', effects={'job','reason','loan','mortdue','value','yoj','derog','delinq','clage','ninq','clno'}} store={name='myModelStore', replace=true}; |
| 5 | |
| 6 | RUN; |
| 7 | regression.logisticAssociation restore='myModelStore' TABLE='hmeq' ctable=true; |
| 8 | |
| 9 | RUN; |
| 10 | |
| 11 | QUIT; |
| 12 |
This example demonstrates how to specify custom cutpoints for the classification table and how to save the classification results to an output CAS table named 'MyCasOut'. The `cutpt` parameter allows for evaluation at specific probability thresholds.
| 1 | |
| 2 | PROC CAS; |
| 3 | regression.logistic |
| 4 | DATA='hmeq' class={'job','reason'} model={depvar='bad', effects={'job','reason','loan','mortdue','value','yoj','derog','delinq','clage','ninq','clno'}} store={name='myModelStore', replace=true}; |
| 5 | |
| 6 | RUN; |
| 7 | regression.logisticAssociation restore='myModelStore' TABLE='hmeq' ctable=true cutpt={0.3, 0.5, 0.7} casOut={name='MyCasOut', replace=true}; |
| 8 | |
| 9 | RUN; |
| 10 | |
| 11 | QUIT; |
| 12 |