Scénario de test & Cas d'usage
Generación de alto volumen (simulado) con múltiples covariables para probar rendimiento y selección.
| 1 | DATA mycas.telco_churn; |
| 2 | call streaminit(999); |
| 3 | array vars[20] x1-x20; |
| 4 | DO id = 1 to 50000; |
| 5 | DO j=1 to 20; vars[j] = rand('NORMAL'); END; |
| 6 | /* Solo x1, x5 y x10 afectan realmente al riesgo */ |
| 7 | Risk = exp(0.5*x1 - 0.3*x5 + 0.8*x10); |
| 8 | Tenure = rand('WEIBULL', 1.5) * 100 / Risk; |
| 9 | Churn = (rand('UNIFORM') > 0.3); |
| 10 | OUTPUT; |
| 11 | END; |
| 12 | RUN; |
| 1 | PROC CAS; |
| 2 | phreg.cox / |
| 3 | TABLE={name='telco_churn'}, |
| 4 | model={depVars={{name='Tenure', event='Churn(0)'}}, effects={{vars={'x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9', 'x10', 'x11', 'x12', 'x13', 'x14', 'x15', 'x16', 'x17', 'x18', 'x19', 'x20'}}}}, |
| 5 | selection={method='LASSO', choose='SBC', stop='SBC'}; |
| 6 | RUN; |
El modelo debe procesar el gran volumen de datos eficientemente. El algoritmo LASSO debe identificar correctamente que 'x1', 'x5' y 'x10' son las variables relevantes, estableciendo los coeficientes de las otras variables (ruido) a cero o cerca de cero en la tabla de resultados de selección.