BookmarkSubscribeRSS Feed
Obsidian | Level 7

I am trying to compare repeated measures on a continuous variable between 2 different groups over time. So let's say the data look like this: 


ID      Group             Time Point 1     Time Point 2     Time Point 3     Time Point 4 

1        Treatment        97                    92                                                90 

2        Treatment        103                 104                      107                   102 

3        Treatment         99                   98                          96 

4         Treatment                               92                          96                    99 

5         Control             100                 95                         94                     90 

6         Control             99                                                                          96 

7         Control             95                   94                          93

8         Control                                     89                          88                     85 



I want to compare the mean score at the different time points between the 2 groups. Notice how there might be missing data at the different time points (most people are not going to have all four time points) so I'm thinking a repeated measures ANOVA of some sort would delete a lot of the responses. What's my best option in SAS? 

Diamond | Level 26

I don't think there is a difference in how GLM and MIXED will handle the missings.


I think the best option would be to use PROC MI to impute values for the missings, and then analyze in GLM or MIXED (your choice). But I haven't ever done this for repeated measures, maybe @Rick_SAS has a suggestion here.

Paige Miller

I'm confused by your ID variable. Do you have four subjects who were each given the Treatment and Placebo? If not, each subject should get a unique  ID value 1-8.


In general, a repeated-measures ANOVA with PROC GLM analyzes data in "wide form" and drops an entire observation when any variable in the analysis has a missing value. It can be used for "balanced" designs where each patient has the same number of repeated measurements and the measurements are taken at the same time points.


If some measurements are missing, the data are called "incomplete".  A mixed-model analysis, which requires that the data be put in "long form" can handle incomplete data and also data in which the response for subjects was measured at different time points.


You can put the data into long form by using variables

ID Treatment Time Value

In your example, some IDs will have four rows, others will have only three rows.

Obsidian | Level 7

Hi Rick,


Sorry for the confusion. The ID's were supposed to be listed as 1-8. 

Obsidian | Level 7

As a follow-up, if a lot of individuals don't have all three time points - it sounds like a mixed model (Proc Mixed) would be my best bet in order not to lose all those data. However, if I just want to study individuals who have all 3 time points (to see what they specifically look like), repeated measures ANOVA (2-factor?) can be used and will take into account treatment group vs. control as well as the time point differences? 


You could do that. Be aware that if the data are not missing at random you might get biased estimates. For example, suppose the subjects that only made three appointments are lower socio-economic status than patients that made all four appointments. If poverty is linked to the response variable (such as obesity or diabetes), you could get biased estimates.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

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.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1 like
  • 3 in conversation