Hi, I am trying to create a new variable that is the average of a variable V1 for every subject. Each subject has 3 rows containing values for V1 that were taken at 3 different time points. I can't calculate the average using a data step: average=(total_V1 / 3) because some subjects have 1-3 missing values for V1. Therefore, for those subjects that are missing V1 values it should be divided by 1 or 2 for example not 3. I can't figure out how to create a variable to go in the denominator of my average calculation to make the numbers accurate, please help! Here is an example of how the data exists: id. V1 1. 3 1. 4 1. 5 2. 6 2. . 2. 7 3. . 3. . 3. 2
... View more