Hi all, I have 3 inputs, one data "Have" and two values in macro variable "value1" and "value2". I am interested in getting the data "want" as per the condition given below. Thanks in advance. data have; infile cards delimiter=","; input col1 col2 col3; cards; 1, 0.01, 100 2, 0.02, 90 3, 0.03, 80 4, 0.04, 70 5, 0.02, 60 6, 0.06, 50 7, 0.07, 40 ; run; %let value1 = -4.608753929; %let value2 = 0.28179071; now, we want to calculate col4 as value1 + (value2*col1) and col5 as EXP(col4)/(1+EXP(col4)) such that sumproduct(col5, col3)/sum(col3) = sumproduct(col2,col3)/sum(col3) by changing the value1 and keeping the value2 same. After optimization the "value1" should be -4.56266639 (computed in excel) and col4, col5 should be as given in the table below: Data Want col1 col2 col3 col4 col5 1 0.01 100 -4.28087568 0.013641871 2 0.02 90 -3.99908497 0.018002379 3 0.03 80 -3.71729426 0.023723163 4 0.04 70 -3.43550355 0.031204128 5 0.02 60 -3.15371284 0.040945231 6 0.06 50 -2.87192213 0.053559135 7 0.07 40 -2.59013142 0.069776252
... View more