phreg cox

Stratified Churn Analysis with Ties Handling

Scénario de test & Cas d'usage

Business Context

A telecom provider analyzes customer churn. They suspect the baseline churn rate differs significantly between geographical regions (North, South, East, West), violating the proportional hazards assumption across regions. Additionally, since tenure is recorded in whole months, there are many tied event times (multiple customers leaving at exactly month 12).
Data Preparation

Create a dataset with categorical regions and discrete tenure times to force ties.

Copied!
1 
2DATA mycas.telco_churn;
3call streaminit(789);
4LENGTH Region $10;
5DO i = 1 to 200;
6IF rand('uniform') < 0.25 THEN Region='North';
7ELSE IF rand('uniform') < 0.5 THEN Region='South';
8ELSE IF rand('uniform') < 0.75 THEN Region='East';
9ELSE Region='West';
10MonthlyCharge = 50 + floor(rand('uniform')*50);
11Tenure = floor(rand('exponential') * 24);
12IF Tenure < 1 THEN Tenure = 1;
13Churn = (rand('uniform') < 0.3);
14OUTPUT;
15END;
16 
17RUN;
18 

Étapes de réalisation

1
Run Stratified Cox Model handling ties with the Efron method.
Copied!
1 
2PROC CAS;
3phreg.cox TABLE={name='telco_churn'}, strata='Region', model={depVars={{name='Tenure', event='Churn(1)'}}, effects={{vars={'MonthlyCharge'}}}, ties='EFRON'};
4 
5RUN;
6 

Expected Result


The output must contain the 'ModelInfo' table confirming 'Efron' was used for ties. The 'ParameterEstimates' will show the effect of 'MonthlyCharge' on churn, while the 'Stratification' table will confirm that separate baselines were computed for North, South, East, and West regions.