data want(drop=date rename=(earning=last_earning)); set have; by person date; retain first_earning_date; format first_earning_date last_earning_date ddmmyy10.; if first.person then do; sum_earning=0; first_earning_date=date; end; sum_earning+earning; if last.person then do; last_earning_date=date; earning_excluding_last=sum_earning-earning; output; end; run;
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.