Hi,
I have a data set with price of 23 drugs in past 5 years.I need to find out each year average price by subtracting current year with previous year divide by two for all 23 drugs and for all years.
I am thinking to use DO loop for year and durgs and use of lag function to get last price.
Can any one one help how to use lag with array. I looked into books they use Retain or lag function with single variable not with multiple.
Thanks,
I have a data set with price of 23 drugs in past 5 years.I need to find out each year average price by subtracting current year with previous year divide by two for all 23 drugs and for all years.
I am thinking to use DO loop for year and durgs and use of lag function to get last price.
Can any one one help how to use lag with array. I looked into books they use Retain or lag function with single variable not with multiple.
Thanks,