Erich Studerus
2009-Feb-27 15:01 UTC
[R] Adjusting confidence intervals for paired t-tests of multiple endpoints
Dear R-users, In a randomized placebo-controlled within-subject design, subjects recieved a psycho-active drug and placebo. Subjects filled out a questionnaire containing 15 scales on four different time points after drug administration. In order to detect drug effects on each time point, I compared scale values between placebo and drug for all time conditions and scales, which sums up to 4*15=60 comparisons. I have summarized the results in a data.frame with columns for t test results including confidence intervals and mean-differences: df1<-data.frame(trt=gl(2,35),matrix(rnorm(4200),70,60)) df2<-as.data.frame(matrix(NA,60,6)) names(df2)<-c('t','df','p','lower','upper','mean.diff') for (i in 1:60) {df2[i,1:6]<-as.numeric( unlist(t.test(df1[,i+1]~df1$trt,paired=T))[1:6])} Now, I want to adjust the confidence intervals for multiple comparisons. For a Bonferroni-adjustment, I did the following: df2$std.error.of.diff<-df2$mean.diff/df2$t ci<-qt(p=1-(0.05/nrow(df2)),df=df2$df)*df2$std.error.of.diff ci.bonf<-data.frame(lower=df2$mean.diff-ci,upper=df2$mean.diff+ci) I hope this is the correct method. However, I think, the Bonferroni-adjustment would be much too conservative. I need a less conservative approach, perhaps, something like Holm's method, which I can easily apply to the p-value with p.adjust(df2$p,method='holm'). Is there package, which can do this for the confidence-interval or could someone provide a simple script to calculate this? Thanks a lot! Erich [[alternative HTML version deleted]]
Dieter Menne
2009-Feb-28 17:41 UTC
[R] Adjusting confidence intervals for paired t-tests of multiple endpoints
Erich Studerus <erich.studerus <at> bli.uzh.ch> writes:> > > Dear R-users, > > In a randomized placebo-controlled within-subject design, subjects recieved > a psycho-active drug and placebo. Subjects filled out a questionnaire > containing 15 scales on four different time points after drug > administration. In order to detect drug effects on each time point, I > compared scale values between placebo and drug for all time conditions and > scales, which sums up to 4*15=60 comparisons. >....> Now, I want to adjust the confidence intervals for multiple comparisons.For simple cases, see p.adjust or TukeyHSD (more limited). For complex cases, see simint and friends in package multcomp. Dieter
Erich Studerus, Psychiatrische Uni-Klinik
2009-Feb-28 20:23 UTC
[R] Adjusting confidence intervals for paired t-tests of multiple endpoints
Thanks, but as far as I know the multcomp package and the tukeyHSD function can only handle one dependent variable, whereas I have 60 dependent variables. Regards, Erich On Sat, 28 Feb 2009 17:41:11 +0000 (UTC) Dieter Menne <dieter.menne at menne-biomed.de> wrote:> Erich Studerus <erich.studerus <at> bli.uzh.ch> writes: > >> >> >> Dear R-users, >> >> In a randomized placebo-controlled within-subject design, subjects >>recieved >> a psycho-active drug and placebo. Subjects filled out a questionnaire >> containing 15 scales on four different time points after drug >> administration. In order to detect drug effects on each time point, I >> compared scale values between placebo and drug for all time conditions and >> scales, which sums up to 4*15=60 comparisons. >> > .... >> Now, I want to adjust the confidence intervals for multiple comparisons. > >For simple cases, see p.adjust or TukeyHSD (more limited). > >For complex cases, see simint and friends in package multcomp. > > Dieter > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.