05-26-2016 07:48 PM
I have a dataset where I want to delete the duplicate entries but the problem is that even though I have a person in there twice with identical demographic characteristics, my variable of interest needs to be averaged out and then I want to delete the second row.
The data set looks as follows:
05-26-2016 08:08 PM
Do you actually want all those variables? SAS has plenty of ways to compute an average.
proc sort data=have;
proc summary data=have;
output out=means (keep=PersonID MeanEXP) mean=MeanEXP;
merge have means;
You don't have to merge the two together ... you could keep the two data sets separate if that fits your needs better.