Scénario de test & Cas d'usage
Simulation de 1000 mois d'indicateurs économiques avec une corrélation induite entre l'inflation et les défauts.
| 1 | |
| 2 | DATA casuser.finance_data; |
| 3 | call streaminit(123); |
| 4 | DO i=1 to 1000; |
| 5 | pib_croissance = rand('Normal', 2, 0.5); |
| 6 | inflation = rand('Normal', 1.5, 0.3); |
| 7 | taux_defaut = 0.5 * inflation - 0.2 * pib_croissance + rand('Normal', 0, 0.1); |
| 8 | OUTPUT; |
| 9 | END; |
| 10 | |
| 11 | RUN; |
| 12 |
| 1 | |
| 2 | PROC CAS; |
| 3 | SIMPLE.correlation / TABLE={name='finance_data'} inputs={{name='pib_croissance'}, {name='inflation'}, {name='taux_defaut'}} casOut={name='finance_corr_matrix', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.fetch / TABLE={name='finance_corr_matrix'}; |
| 4 | |
| 5 | RUN; |
| 6 |
L'action génère les statistiques descriptives à l'écran et produit une table CAS 'finance_corr_matrix' persistante contenant les coefficients de Pearson, permettant de confirmer la corrélation positive entre l'inflation et le taux de défaut.