I am trying to create a dataset with yearmonth and the decreasing rate.
I want to create a dataset with date variable and average rate decaying at a fix rate; After 50 months I want the value to be equal to the
to avg_date as after certain time peroid it will be zero and negative.
%let avg_dt=0.02345; %let avg_date=0.01234; %let projected_month=50;
This give of rate of decrease to be 0.00016
For first obs, date=201708 and rate=0.02345;
for second obs, date=201708 and rate=(0.02345-00016)=0.023289
for third obs, date=201708 and rate=0.023289-00016=0.023128
so that the fifth obs rate=0.01234;
for the date value after that, i want to retain this value.
data dates; format date yymmn6.; date=201601; do while(date=202501); output; date=intnx('month', date, 1); rate=lag(&avg_dt)-00016; end; run;
Thank you in advance.
... View more