Scénario de test & Cas d'usage
Creation of a dataset with random missing values (NULL) in predictor variables to test robustness.
| 1 | |
| 2 | DATA mycas.mfg_defects; |
| 3 | call streaminit(456); |
| 4 | DO batch = 1 to 500; |
| 5 | Temperature = rand('NORMAL', 100, 10); |
| 6 | IF rand('UNIFORM') < 0.1 THEN Temperature = .; |
| 7 | Pressure = rand('NORMAL', 50, 5); |
| 8 | IF rand('UNIFORM') < 0.05 THEN Pressure = .; |
| 9 | Defects = rand('POISSON', exp(0.02 * (ifn(Temperature=., 100, Temperature)) - 0.01 * Pressure)); |
| 10 | OUTPUT; |
| 11 | END; |
| 12 | |
| 13 | RUN; |
| 14 |
| 1 | |
| 2 | PROC CAS; |
| 3 | countreg.countregFitModel / TABLE={name='mfg_defects'} model={depVars={{name='Defects'}}, effects={{vars={'Temperature', 'Pressure'}}}, modeloptions={modeltype='POISSON'}} selection={method='LASSO'} store={name='defect_model_store', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.fileInfo / path='defect_model_store.sashdat'; |
| 4 | |
| 5 | RUN; |
| 6 |
The action completes successfully. Observations with missing values in 'Temperature' or 'Pressure' are excluded from the analysis (standard SAS behavior), but the process does not crash. The 'defect_model_store' is successfully created for future scoring.