Scénario de test & Cas d'usage
Creating a dataset of policyholders with age groups, car segments, and claim counts.
| 1 | |
| 2 | DATA casuser.insurance_claims; |
| 3 | call streaminit(123); |
| 4 | DO i=1 to 1000; |
| 5 | u = rand('Uniform'); |
| 6 | IF u < 0.3 THEN age_group='Young'; |
| 7 | ELSE IF u < 0.7 THEN age_group='Middle'; |
| 8 | ELSE age_group='Senior'; |
| 9 | IF rand('Uniform') < 0.5 THEN car_type='Sedan'; |
| 10 | ELSE car_type='SUV'; |
| 11 | claims = rand('Poisson', 0.5); |
| 12 | OUTPUT; |
| 13 | END; |
| 14 | |
| 15 | RUN; |
| 16 |
| 1 | |
| 2 | PROC CAS; |
| 3 | countreg.countregFitModel / TABLE='insurance_claims', model={depVars={{name='claims'}}, effects={{vars={'age_group', 'car_type'}}}}, dist='POISSON', store={name='claim_model_store', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | countreg.countregViewStore / TABLE='insurance_claims', instore='claim_model_store', viewOptions={covariances=true, finalEstimates=true}, outputTables={names={ParameterEstimates='audit_estimates', replace=true}}; |
| 4 | |
| 5 | RUN; |
| 6 |
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.