countreg countregFitModel

Standard Risk Modeling for Auto Insurance

Scénario de test & Cas d'usage

Business Context

An auto insurance provider wants to estimate the expected number of claims per policyholder based on driver age, vehicle type, and region. This helps in adjusting premium rates for different risk profiles using a standard Poisson regression.
Data Preparation

Generation of 1,000 policyholder records with age, car type, and claim counts derived from a Poisson distribution.

Copied!
1 
2DATA mycas.insurance_claims;
3call streaminit(12345);
4DO policy_id = 1 to 1000;
5Age = 18 + floor(rand('UNIFORM') * 60);
6CarType = ifn(rand('UNIFORM') > 0.3, 'Sedan', 'Sport');
7Region = ifn(rand('UNIFORM') > 0.5, 'Urban', 'Rural');
8RiskBase = -1.5 + 0.02 * Age + 0.5 * (CarType='Sport') + 0.3 * (Region='Urban');
9Lambda = exp(RiskBase);
10NumClaims = rand('POISSON', Lambda);
11OUTPUT;
12END;
13 
14RUN;
15 

Étapes de réalisation

1
Fit a standard Poisson regression model using Class variables for categorical inputs.
Copied!
1 
2PROC CAS;
3countreg.countregFitModel / TABLE={name='insurance_claims'} class={'CarType', 'Region'} model={depVars={{name='NumClaims'}}, effects={{vars={'Age', 'CarType', 'Region'}}}, modeloptions={modeltype='POISSON'}};
4 
5RUN;
6 
2
Verify model convergence and parameter estimates for risk factors.
Copied!
1 
2PROC CAS;
3countreg.countregFitModel / TABLE={name='insurance_claims'} class={'CarType'} model={depVars={{name='NumClaims'}}, effects={{vars={'CarType'}}}} outputTables={names={ParameterEstimates='params'}};
4 
5RUN;
6 

Expected Result


The model successfully converges. The 'ParameterEstimates' table shows positive coefficients for 'Sport' cars and 'Urban' regions, indicating higher expected claim counts, validating the business logic.