/*
Rick,
Since there are so many features in simulated data,
I would like to use Genetic Algorithm(a general tool to solve any problem).
*/
proc iml;
start function(x) ;
xx=shape(x,0,1);
/*
The average check value was $291.
The median check value was $100.
*/
sse=ssq(mean(xx)-291,median(xx)-100);
return (sse);
finish;
sample=40*20; /**39.6 checks per year for 20 Subjects*/
encoding=j(2,sample,2 ); /*minimum check value was $2*/
/*
the maximum was $30,000.
it is way too extreme,so I used a small value for the sake of convergence.
*/
encoding[2,]=3000 ;

id=gasetup(2,sample,123456789);
call gasetobj(id,0,"function");
/*call gasetsel(id,10,1,1);*/
call gainit(id,1000,encoding);

niter = 10000 ; /*the number of iteration*/
do i = 1 to niter;
call garegen(id);
call gagetval(value, id);
end;
call gagetmem(Amount, value, id, 1);

print value[l = "Min Obj Value:"] ;
create want var{Amount};
append;
close;
call gaend(id);
quit;

proc means data=want Min Mean Median Max ndec=2;
var Amount;
run;

Analysis Variable : AMOUNT
Minimum Mean Median Maximum
2.00 291.00 99.50 2677.00