Scénario de test & Cas d'usage
Create a dataset with categorical regions and discrete tenure times to force ties.
| 1 | |
| 2 | DATA mycas.telco_churn; |
| 3 | call streaminit(789); |
| 4 | LENGTH Region $10; |
| 5 | DO i = 1 to 200; |
| 6 | IF rand('uniform') < 0.25 THEN Region='North'; |
| 7 | ELSE IF rand('uniform') < 0.5 THEN Region='South'; |
| 8 | ELSE IF rand('uniform') < 0.75 THEN Region='East'; |
| 9 | ELSE Region='West'; |
| 10 | MonthlyCharge = 50 + floor(rand('uniform')*50); |
| 11 | Tenure = floor(rand('exponential') * 24); |
| 12 | IF Tenure < 1 THEN Tenure = 1; |
| 13 | Churn = (rand('uniform') < 0.3); |
| 14 | OUTPUT; |
| 15 | END; |
| 16 | |
| 17 | RUN; |
| 18 |
| 1 | |
| 2 | PROC CAS; |
| 3 | phreg.cox TABLE={name='telco_churn'}, strata='Region', model={depVars={{name='Tenure', event='Churn(1)'}}, effects={{vars={'MonthlyCharge'}}}, ties='EFRON'}; |
| 4 | |
| 5 | RUN; |
| 6 |
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.