# Re: [R] How to analyse simple study: Placebo-controlled (2 groups) repeated measurements (ANOVA, ANCOA???)

From: Karl Knoblick <karlknoblich_at_yahoo.de>
Date: Wed, 30 May 2007 11:53:07 +0000 (GMT)

Dear Frank Harrell,

I have downloaded your Harrell_notes.pdf and I think it would be best to have a look in some books you mentioned in the bibliographie. Can you recommend one especially?

TO ANYBODY:
Has anybody examples for similar data sets (as below) with R code? This would be a great help!

(My impression of the example of Frank Harrell at the end of Harrell_notes.pdf is that it is more complicated and therefore more difficult to understand than the simplier data set I want to analyse.)

Thanks!!!
Karl

• Ursprüngliche Mail ---- Von: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu> An: Karl Knoblick <karlknoblich_at_yahoo.de> CC: r-help_at_stat.math.ethz.ch Gesendet: Donnerstag, den 17. Mai 2007, 14:29:08 Uhr Betreff: Re: [R] How to analyse simple study: Placebo-controlled (2 groups) repeated measurements (ANOVA, ANCOA???)

Karl Knoblick wrote:
> Hallo!
>
> I have two groups (placebo/verum), every subject is measured at 5 times, the first time t0 is the baseline measurement, t1 to t4 are the measurements after applying the medication (placebo or verum). The question is, if there is a significant difference in the two groups and how large the differnce is (95% confidence intervals).
>
> Let me give sample data
> # Data
> ID<-factor(rep(1:50,each=5)) # 50 subjects
> GROUP<-factor(c(rep("Verum", 115), rep("Placebo", 135)))
> TIME<-factor(rep(paste("t",0:4,sep=""), 50))
> set.seed(1234)
> Y<-rnorm(250)
> # to have an effect:
> Y[GROUP=="Verum" & TIME=="t1"]<-Y[GROUP=="Verum" & TIME=="t1"] + 0.6
> Y[GROUP=="Verum" & TIME=="t2"]<-Y[GROUP=="Verum" & TIME=="t2"] + 0.3
> Y[GROUP=="Verum" & TIME=="t3"]<-Y[GROUP=="Verum" & TIME=="t3"] + 0.9
> Y[GROUP=="Verum" & TIME=="t4"]<-Y[GROUP=="Verum" & TIME=="t4"] + 0.9
> DF<-data.frame(Y, ID, GROUP, TIME)
>
> I have heard of different ways to analyse the data
> 1) Comparing the endpoint t4 between the groups (t-test), ignoring baseline

Don't even consider this

This is not optimal

Using t0 as a covariate is the way to go. A question is whether to just use t4. Generally this is not optimum.

> 4) Taking a summary score (im not sure but this may be a suggestion of Altman) istead of t4
> 5) ANOVA (repeated measurements) times t0 to t5, group placebo/verum), subject as random factor - interested in interaction times*groups (How to do this in R?)
> 6) as 5) but times t1 to t5, ignoring baseline (How to do this in R?)
> 7) as 6) but additional covariate baseline t0 (How to do this in R?)
>
> How to analyse these models in R with nested and random effects and possible covariate(ID, group - at least I think so) and random parameter ID)? Or is there a more simple possibility?

It's not obvious that random effects are needed if you take the correlation into account in a good way. Generalized least squares using for example an AR1 correlation structure (and there are many others) is something I often prefer. A detailed case study with R code (similar to your situation) is in http://biostat.mc.vanderbilt.edu/FrankHarrellGLS .   This includes details about why t0 is best to consider as a covariate.   One reason is that the t0 effect may not be linear.

If you want to focus on t4 it is easy to specify a contrast (after fitting is completed) that tests t4. If time is continuous this contrast would involve predicted values at the 4th time, otherwise testing single parameters.

Frank Harrell

```--
Frank E Harrell Jr   Professor and Chair           School of Medicine
Department of Biostatistics   Vanderbilt University

__________________________________  Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help