regression

logisticType3

Description

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.

regression.logisticType3 <result=results> <status=rc> / display={displayTables}, outputTables={outputTables}, restore={castable};
Settings
ParameterDescription
restoreSpecifies the input model to use for the analysis, which must be a model store created by the `logistic` action.
displaySpecifies a list of results tables to be displayed to the client. If omitted, no tables are displayed.
outputTablesSpecifies a list of results tables to be saved as CAS tables on the server for subsequent analysis.
Data Preparation View data prep sheet
Data Creation: Sample Home Equity Data

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.

Copied!
1DATA 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;
21, 1100, 25860, 39025, HomeImp, Other, 10.5, 0, 1, 9, 0
31, 1300, 70053, 68400, HomeImp, Other, 7, 2, 0, 8, 0
41, 1500, 13500, 16700, HomeImp, Other, 4, 0, 0, 14, 0
50, 1700, 97800, 112000, HomeImp, Office, 3, 0, 0, 14, 0
61, 1700, 30548, 40320, HomeImp, Other, 9, 0, 0, 10, 37.113614
71, 1800, 48649, 57037, HomeImp, Other, 5, 3, 0, 10, 34.055627
80, 2000, 65000, 88000, HomeImp, Office, 17, 0, 0, 21, 34.818225
91, 2300, 78000, 92000, HomeImp, Office, 7, 0, 0, 19, 36.0
101, 2400, 35000, 54000, HomeImp, Mgr, 1, 0, 0, 1, 0
11;RUN;

Examples

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2regression.logistic TABLE='my_hmeq', class={'job','reason'}, model={depvar='bad', effects={'job','reason','loan','mortdue'}}, store={name='myModel', replace=true};
3regression.logisticType3 restore='myModel';
4RUN; QUIT;
Result :
The output will be a 'Type 3 Tests' table, showing the degrees of freedom, Wald Chi-Square statistic, and the p-value (ProbChiSq) for each effect in the model.

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2regression.logistic TABLE='my_hmeq', class={'job','reason'}, model={depvar='bad', effects={'job','reason','loan','mortdue'}}, store={name='myModel', replace=true};
3regression.logisticType3 restore='myModel', outputTables={names={Type3='myType3Results', replace=true}};
4RUN; QUIT;
Result :
The action itself does not produce any displayed output because the results are redirected. A new CAS table named `myType3Results` is created in the current caslib, containing the detailed Type 3 analysis results.

FAQ

What is the primary function of the `logisticType3` action?
What is the purpose of a Type 3 test in this context?
Which parameter is mandatory when using the `logisticType3` action?
How does the `logisticType3` action get the model to analyze?