countreg countregViewStore

Standard Model Audit for Insurance Claims

Scénario de test & Cas d'usage

Business Context

An insurance company has trained a Poisson regression model to predict the frequency of claims based on driver age and car segment. The Risk Auditing department needs to review the model's covariance matrix and final parameter estimates to ensure regulatory compliance without retraining the model. They require these specific metrics to be displayed and saved for the audit report.
Data Preparation

Creating a dataset of policyholders with age groups, car segments, and claim counts.

Copied!
1 
2DATA casuser.insurance_claims;
3call streaminit(123);
4DO i=1 to 1000;
5u = rand('Uniform');
6IF u < 0.3 THEN age_group='Young';
7ELSE IF u < 0.7 THEN age_group='Middle';
8ELSE age_group='Senior';
9IF rand('Uniform') < 0.5 THEN car_type='Sedan';
10ELSE car_type='SUV';
11claims = rand('Poisson', 0.5);
12OUTPUT;
13END;
14 
15RUN;
16 

Étapes de réalisation

1
Fit the initial Poisson model and save the model state to an item store named 'claim_model_store'.
Copied!
1 
2PROC CAS;
3countreg.countregFitModel / TABLE='insurance_claims', model={depVars={{name='claims'}}, effects={{vars={'age_group', 'car_type'}}}}, dist='POISSON', store={name='claim_model_store', replace=true};
4 
5RUN;
6 
2
Inspect the saved model using countregViewStore. Explicitly request the Covariance matrix and Final Estimates using viewOptions, and save the Estimates to a CAS table for the audit trail.
Copied!
1 
2PROC CAS;
3countreg.countregViewStore / TABLE='insurance_claims', instore='claim_model_store', viewOptions={covariances=true, finalEstimates=true}, outputTables={names={ParameterEstimates='audit_estimates', replace=true}};
4 
5RUN;
6 

Expected Result


The action should successfully load the 'claim_model_store'. The SAS log/output should display only the Covariance Matrix and Parameter Estimates tables. A new CAS table named 'audit_estimates' should be created containing the model parameters.