08-07-2015 03:07 PM
I have 1 variabel A. I need to create a new variabel B thats i created through the retain function. For the first observation must B must be equal to 1.
For all the other values B=1-B*A - where B is the retained result.
As an example:
0,5 0,5 (calculated as: 1-1*0,5)
0,5 0,75 (calculated as: 1-0,5*0,5)
08-10-2015 09:20 AM
I am not clear on what the dataset A is for, it doesn't add anything to the mix. Adjust the do loop for number of iterations:
data want (drop=i);
retain b 1;
do i=1 to 5;
b=1 - (b * 0.5);