I want to create a data set that calculates a variable, ADJ_PIA, as PIA*(1+COLA) for observation 1. Then, for subsequent observations, the calculation should be ADJ_PIA*(1+COLA). Basically, each year the ADJ_PIA from the previous year should increase by the COLA percent. The COLA is currently 2%, but could become variable later on. Here is how the observations should look. It represents a 2% increase over the previous value each time: YEAR PIA COLA ADJ_PIA 2018 $1,000.00 0 $1,000.00 2019 $1,000.00 2% $1,020.00 2020 $1,000.00 2% $1,040.40 2021 $1,000.00 2% $1,061.21 2022 $1,000.00 2% $1,082.43 This is the first code I tried. It's been pointed out that this is not valid. if year=2018 then ADJ_PIA=PIA;
else ADJ_PIA*(1+COLA); Next code I tried: ADJ_PIA=PIA*(1+COLA);
LAG_ADJ_PIA = LAG(ADJ_PIA);
ADJ_PIA2=LAG(ADJ_PIA)*(1+COLA); This one doesn't have an error because it's valid. It just isn't what I want to happen. I don't even know how to search for what I want to do because I don't have a name for this process. Any help is greatly appreciated.
... View more