Hi there! I have repeated measures data in long format. Several subjects have multiple observations within the same binned time period. I would like to average the values for that subject within that time period (rather than selecting just one). For example, (I've pasted the data frame below) subject 002E5 has three observations for time point -0.5 (variable name timecat), and three observations for time point 0.5; subject 003E5 has two observations for time point -3.0, etc. I am looking for a more efficient way to get the average value at time point x for subject y with all of the time points in one data set as opposed to splitting the data into each time category and getting the time point and subject specific averages and then merging it all together again. I know how to get the average by unique ID, but can't figure out how to add the additional condition of timecat. I've attached a snippet of the data in sas7bdat format. Thanks! Obs POST logvl timecat ID 0 5.2 -0.5 002E5 0 3.9 -0.5 002E5 0 3.6 -0.5 002E5 0 2.7 0.0 002E5 0 5.5 0.5 002E5 0 3.4 0.5 002E5 0 2.7 0.5 002E5 0 0.0 -3.0 003E5 0 3.5 -3.0 003E5 0 3.0 -2.5 003E5 0 4.9 -1.0 003E5 0 5.1 -0.5 003E5 0 4.8 -0.5 003E5 0 1.7 0.5 003E5 0 0.0 0.5 003E5 0 3.5 1.0 003E5 0 2.1 1.0 003E5 0 0.0 1.0 003E5 0 0.0 1.0 003E5 0 0.0 1.5 003E5
... View more