Action Principale : bartProbit
| 1 | DATA purchase_data; |
| 2 | call streaminit(123); |
| 3 | DO i = 1 to 1000; |
| 4 | Age = 20 + int(rand('Uniform') * 50); |
| 5 | Income = 30000 + int(rand('Uniform') * 70000); |
| 6 | IF rand('Uniform') > 0.5 THEN Gender = 'Male'; |
| 7 | ELSE Gender = 'Female'; |
| 8 | logit_p = -4 + 0.05*Age + 0.00002*Income + (Gender='Female'); |
| 9 | p = 1 / (1 + exp(-logit_p)); |
| 10 | Purchased = rand('Bernoulli', p); |
| 11 | OUTPUT; |
| 12 | END; |
| 13 | RUN; |
| 14 | |
| 15 | DATA casuser.purchase_data; |
| 16 | SET purchase_data; |
| 17 | RUN; |