The logisticType3 action computes Type 3 or Joint tests for a previously fitted logistic regression model. These tests are used to assess the overall significance of an effect that has multiple parameters, such as a categorical variable with several levels. The action requires a model store as input, which is generated by the `logistic` action.
| Parameter | Description |
|---|---|
| restore | Specifies the input model to use for the analysis, which must be a model store created by the `logistic` action. |
| display | Specifies a list of results tables to be displayed to the client. If omitted, no tables are displayed. |
| outputTables | Specifies a list of results tables to be saved as CAS tables on the server for subsequent analysis. |
This SAS DATA step creates the `my_hmeq` table in your current caslib. This table contains simulated data about home equity loans, including a binary target variable `bad` that indicates whether a customer defaulted on a loan. This data will be used to first fit a logistic regression model.
| 1 | DATA my_hmeq (caslib=casuser); LENGTH reason $ 7 job $ 7; INFILE DATALINES dsd; INPUT bad loan mortdue value reason $ job $ yoj delinq ninq clno debtinc; DATALINES; |
| 2 | 1, 1100, 25860, 39025, HomeImp, Other, 10.5, 0, 1, 9, 0 |
| 3 | 1, 1300, 70053, 68400, HomeImp, Other, 7, 2, 0, 8, 0 |
| 4 | 1, 1500, 13500, 16700, HomeImp, Other, 4, 0, 0, 14, 0 |
| 5 | 0, 1700, 97800, 112000, HomeImp, Office, 3, 0, 0, 14, 0 |
| 6 | 1, 1700, 30548, 40320, HomeImp, Other, 9, 0, 0, 10, 37.113614 |
| 7 | 1, 1800, 48649, 57037, HomeImp, Other, 5, 3, 0, 10, 34.055627 |
| 8 | 0, 2000, 65000, 88000, HomeImp, Office, 17, 0, 0, 21, 34.818225 |
| 9 | 1, 2300, 78000, 92000, HomeImp, Office, 7, 0, 0, 19, 36.0 |
| 10 | 1, 2400, 35000, 54000, HomeImp, Mgr, 1, 0, 0, 1, 0 |
| 11 | ;RUN; |
This example first fits a logistic regression model on the `my_hmeq` data, saving the model to an item store named `myModel`. It then runs a Type 3 analysis on this stored model to test the joint significance of each model effect.
| 1 | PROC CAS; |
| 2 | regression.logistic TABLE='my_hmeq', class={'job','reason'}, model={depvar='bad', effects={'job','reason','loan','mortdue'}}, store={name='myModel', replace=true}; |
| 3 | regression.logisticType3 restore='myModel'; |
| 4 | RUN; QUIT; |
This example performs a Type 3 analysis on a logistic regression model and saves the results to a CAS table named `myType3Results` for further processing. The `outputTables` parameter is used to specify the name of the output table.
| 1 | PROC CAS; |
| 2 | regression.logistic TABLE='my_hmeq', class={'job','reason'}, model={depvar='bad', effects={'job','reason','loan','mortdue'}}, store={name='myModel', replace=true}; |
| 3 | regression.logisticType3 restore='myModel', outputTables={names={Type3='myType3Results', replace=true}}; |
| 4 | RUN; QUIT; |