group by subjectid and activity and calculate the average of each variable.