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?
April 27 - 30 | GAYLORD TEXAN
Register now to lock in early bird pricing through February 25!
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.
Ready to level-up your skills? Choose your own adventure.
Browse our catalog!