I am stacking the data and making R chew on it, so that the final input looks something like this...

Now, We want to see if there is difference in TotalActivity (the values in the trial variable in the first table) Between the groups represented in FinalID (6 groups).

I factor the relevant fields after importing the CSV and perform the repeated measures ANOVA in R like so

Code:

```
Data <- within(Data, {
FinalID <- factor(FinalID)
AnimalID <- factor(AnimalID)
Trial <- factor(Trial)
})
aov.out = aov(TotalActivity~FinalID*Trial + Error(AnimalID), data=Data)
PostHoc <- with(Data,pairwise.t.test(TotalActivity,FinalID,p.adjust.method="bonferroni"))
print(summary(aov.out))
print(PostHoc)
```

Okay, now the confession is that statistics is not my forte, and am a bit confused how to set up my repeated measures. I googled it and found a couple of formulas like so

Code:

```
aov.out = aov(TotalActivity~FinalID*Trial + Error(AnimalID), data=Data)
aov.out = aov(TotalActivity~FinalID + Error(AnimalID/FinalID), data=Data)
```

KR

TBA