Hello,
I need to create a data set like that bellow.
where variable "a" need to be the value of the previous value of the variable "c" and so on.
b = a * anual/12;
Thanks
Getting A is straightforward:
data want;
set have;
a = lag(c);
if _n_=1 then a=c;
run;
Getting B a value of 0 can also be done (but requires a little more coding), if you are computing B as part of this step. It might depend on what is in ANNUAL. Is it character, with a value of "2.97%" or is it numeric with a value of 0.297?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Submit your idea!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for:
View all other training opportunities.