I'm calculating the area under the curve for time series measurements for n individuals and I want to do this for more than ten different variables: data want; set have; by id; var1area+dif(date)*mean(var1,lag(var1));if first.id then var1area=0; var2area+dif(date)*mean(var2,lag(var1));if first.id then var2area=0; ...; run; It runs well, however, when I tried to put this into an array function it didn't work most likely because of the "if first.id then _var(i)area =0. All columns except the first one will give me 0 in every observation. Does anyone have a solution?
... View more