Hi everyone, Essentially, I need to make a new column with a summation of a few other variables--here's a mathematical expression of the new variable I need to make. VarA and VarB are continuous variables present in other rows. I'm basically trying to make a new column in my dataset with the value given by the following equation: What code can I write to make a new column with the results of this summation, given that I already have an integer value in each row for columns VarA and VarB? I googled this and tried using a "do loop," but it hasn't been working. Here's what I've tried: data want(drop=t); set have; do t=1 to t=VarA; sum + (1-VarB/((1.03)**(t-1)); end; run; To make it clearer, an example of my larger dataset is below: ID VarA VarB 1 7 0.3 2 9 0.4 3 4 0.2 4 12 0.3 5 16 0.2 I'm trying to make a new column with values populated by the summation equation given above. Please let me know if I can provide any additional information and I'm happy to do so, been stuck on this all week!
... View more