Hello All
I'm trying to replicate in SAS a procedure I use in Excel. This procedure is basically an iterative solver (through a macro) that puts the variable Delta (Sum square error of actual and predicted value) to minimum value by changing the values of the Index value(starting with null values) used to calculate predict value.
The input data start like this:
| bucket | score | actual | predicted | delta | index |
| 1 | -2.38219 | 0.011488 | . | . | . |
| 2 | -0.64283 | 0.323792 | . | . | . |
| 3 | -0.19096 | 0.5008 | . | . | . |
| 4 | 0.379314 | 0.693121 | . | . | . |
- bucket, score and actual are inputs;
- index values are generated by Excel; Used in calculating predicted which is further used to find the delta
- predicted is given by NORM.S.DIST(score + index, TRUE)
- Delta is minimum sum square error (actual, predicted)
The solver objective function is Delta, it operates by changing index values and the constraint is predicted value should be such that minimum delta value. It runs for each cell.
After solver macro, the desired output is:
| bucket | score | actual | predicted | delta | index |
| 1 | -2.38219 | 0.011488 | 0.013501 | 0.000359105 | 0.170699 |
| 2 | -0.64283 | 0.323792 | 0.318416 | 0.000359105 | 0.170699 |
| 3 | -0.19096 | 0.5008 | 0.491916 | 0.000359105 | 0.170699 |
| 4 | 0.379314 | 0.693121 | 0.708845 | 0.000359105 | 0.170699 |
Is there a way to do this in SAS except for proc optmodel as I don't have license for SAS/OR?
I have been trying and searching for a few days, without success.
If anyone could help with the code for this, it would be very much helpful and appreciated.
Kind Regards,
Satyakshma Rawat
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.