Scénario de test & Cas d'usage
Simulation of 5000 sensor readings with continuous Temperature and Status.
| 1 | |
| 2 | DATA casuser.sensors; |
| 3 | call streaminit(999); |
| 4 | DO i=1 to 5000; |
| 5 | Temperature = rand('NORMAL', 80, 15); |
| 6 | IF Temperature > 100 THEN STATUS='Error'; |
| 7 | ELSE STATUS='Operational'; |
| 8 | OUTPUT; |
| 9 | END; |
| 10 | |
| 11 | RUN; |
| 12 |
| 1 | |
| 2 | PROC CAS; |
| 3 | SIMPLE.crossTab / TABLE={name='sensors', caslib='casuser'} row='Temperature' col='Status' rowNBins=5 niceBinning=true chiSq=true; |
| 4 | |
| 5 | RUN; |
| 6 |
The output should display the 'Temperature' variable grouped into 5 intervals. It must also include the 'ChiSq' table containing the p-value, confirming the strong correlation between high temperature bins and 'Error' status.