Repeated measures ANOVA in R and Bonferroni adjusted intervals If somebody can tell me what R commands I need to use for a repeated measures ANOVA, I'd really appreciate it. I have trouble with the random term. I've seen random=id, random=id/(treatment*group) and others. 
Also can you please indicate to me what the formula for the Bonferroni adjusted intervals is?
 A: I agree with suncoolsu that it is difficult to tell exactly what you were looking for.  And in general it's not recommended to do standard repeated measures ANOVAs anymore since there are generally better alternatives.  
Nevertheless, perhaps you want to generate a simple stratified ANOVA.  By stratified I mean that your effects are measured within another grouping variable, in your case the subject and thus a within subjects design.  If your data frame is df and your response variable is y then you might have a within subjects predictor x1 and that crossed with a within subjects predictor x2, and perhaps a between subjects predictor z.  To get the full model with all interactions you would use.
myModel <- aov( y ~ x1 * x2 * z + Error(id/(x1*x2)), data = df)
summary(myModel)

You'll note that within the Error term we are grouping x1, x2, and their interaction under id.  Note that z is not in there because it is not a within subjects variable.
Keep in mind further that this data is laid out in long format and you probably need to aggregate it first to run this correctly since a repeated measures design often suggests more samples / subject than conditions in order to get good estimates of each subject's response value.  Therefore, df above might be replaced with the following dfa.
dfa <- aggregate ( y ~ x1 + x2 + z + id, data = df, mean)

(BTW, suncoolsu gave a much more modern answer based on multi-level modelling.  It's suggested you learn about that if you continue to do repeated measures designs because it is much more powerful, flexible, and allows one to ignore certain kinds of within subjects assumptions (notably sphericity).  What I've described is how to do repeated measure ANOVA.  You also might want to look at the car, or higher level ez packages in order to do it as well.)
As for your Bonferroni query... it should probably have been a separate question.  Nevertheless, that's a bit of a hard one to answer with repeated measures.  You could try ?pairwise.t.test.  If you give the interactions of all your within variables as the group factor and set paired to true and the correction to bonf you're set.  However, straight corrections like that probably are far too conservative.  You state at the outset you're only going to use it if there is a significant effect, you probably also have a theoretical reason for making some comparisons, therefore it's not strictly the fishing expedition that Bonferroni (over) corrects for.  So, something like...
with( df, pairwise.t.test(y, x1:x2, paired = TRUE, p.adj = 'bonf') )

will do what you want but that's probably not really what you want.
A: You should provide more details about your data. From the limited details provided by you, assuming you have a data frame df which has response, trt, time, and subject information, then these are many ways to fit a LME model in R using lme4 package. However, I will illustrate three methods that I think will be useful for you.
library(lme4)

# Random intercepts for different subjects but time and trt effects are fixed 
mmod1 <- lmer(response ~ time*trt + (1 | subject), df)

# Random intercepts and trt effects for different subjects, but the time effect is still fixed
mmod2 <- lmer(response ~ time*trt + (1 + trt | subject), df)

# Random intercepts, trt, and time effects for different subjects
mmod3 <- lmer(response ~ time*trt + (1 + trt + time | subject), df)

Once you have the p-values from the model fit above, you can use:
HPDinterval(mmod1, prob = 0.95, ...)
HPDinterval(mmod2, prob = 0.95, ...)
HPDinterval(mmod3, prob = 0.95, ...)

to obtain the 95% CI determined from MCMC sample. Since this CI is obtained from MCMC sampling, it takes into account of the random errors and you won't need to correct for multiple comparisons (I think so, please correct me if I am wrong).
