Scénario de test & Cas d'usage
Simulate a dataset of 5,000 banking customers with correlated variables (Income, Debt, Credit Score) and Age.
| 1 | |
| 2 | DATA mycas.credit_risk; |
| 3 | call streaminit(123); |
| 4 | DO i=1 to 5000; |
| 5 | Income = rand('lognormal', 10, 0.5); |
| 6 | Debt = (Income * 0.4) + rand('normal', 0, 2000); |
| 7 | Age = rand('integer', 18, 75); |
| 8 | CreditScore = 800 - (Debt/100) + (Age * 1.5) + rand('normal', 0, 30); |
| 9 | OUTPUT; |
| 10 | END; |
| 11 | |
| 12 | RUN; |
| 13 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.tableInfo TABLE="credit_risk"; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | SIMPLE.correlation TABLE={name='credit_risk'} inputs={'Income', 'Debt', 'Age', 'CreditScore'} alpha=true casOut={name='corr_stats', replace=true} descriptiveStats=true; |
| 4 | |
| 5 | RUN; |
| 6 |
The action successfully computes the correlation matrix showing strong positive correlation between Income and Debt, and correlations between CreditScore and other factors. Cronbach's Alpha is calculated and displayed in the results. A new CAS table 'corr_stats' is created containing the statistical output.