[R] pmvt problem in multcomp

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Wed Jun 16 08:04:08 CEST 2004


On Wed, 26 May 2004, Chihiro Kuroki wrote:

>

<snip>

>
> BTW, I have another strange example of simtest. I want to know
> why simtest returns these p-values.
>
> -- example 1 -------------------------------
> rm(list = ls())
> require(multcomp)
> y1 <- c(seq(3,7),seq(3,7))
> y2 <- c(rep(c(6,7,8,9),7))
> sort(runif(28),index=T) -> a
> y3 <- numeric(0)
> for(i in 1:28){
>   y3[i] <- y2[a$ix[i]]
> }
> y4 <- c(y1,y3,14,18)
>
> f2 <- factor(c(rep(1,10),rep(2,8),rep(3,8),rep(4,8),rep(5,6)))
> dat2 <- cbind(as.data.frame(y4),f2)
> summary(simtest(y4 ~ f2, data=dat2, type="Dunnett"))
>
> > dat2
>    y4 f2
> 1   3  1
> 2   4  1
> 3   5  1
> 4   6  1
> 5   7  1
> 6   3  1
> 7   4  1
> 8   5  1
> 9   6  1
> 10  7  1
> 11  6  2
> 12  7  2
> 13  6  2
> 14  9  2
> 15  7  2
> 16  8  2
> 17  6  2
> 18  8  2
> 19  9  3
> 20  8  3
> 21  7  3
> 22  9  3
> 23  6  3
> 24  8  3
> 25  9  3
> 26  7  3
> 27  7  4
> 28  9  4
> 29  6  4
> 30  6  4
> 31  9  4
> 32  8  4
> 33  7  4
> 34  9  4
> 35  6  5
> 36  8  5
> 37  8  5
> 38  7  5
> 39 14  5
> 40 18  5
> > summary(simtest(y4 ~ f2, data=dat2, type="Dunnett"))
>
> 	 Simultaneous tests: Dunnett contrasts
>
> Call:
> simtest.formula(formula = y4 ~ f2, data = dat2, type = "Dunnett")
>
> 	 Dunnett contrasts for factor f2
>
> Contrast matrix:
>           f21 f22 f23 f24 f25
> f22-f21 0  -1   1   0   0   0
> f23-f21 0  -1   0   1   0   0
> f24-f21 0  -1   0   0   1   0
> f25-f21 0  -1   0   0   0   1
>
>
> Absolute Error Tolerance:  0.001
>
> Coefficients:
>         Estimate t value Std.Err. p raw p Bonf p adj
> f25-f21    5.167  -4.644    1.022 0.000  0.000 0.000
> f23-f21    2.875  -2.813    1.022 0.008  0.024 0.022
> f24-f21    2.625  -2.569    1.022 0.015  0.029 0.028
> f22-f21    2.125  -2.079    1.113 0.045  0.045 0.045
> ---------------------------------
>
> I got the following inequality from the appended chart of a
> book.
>
> 2.558 < d(5, 35, 0.4263464, 0.05) < 2.598
>
> Are these "p adj" values right?

Chihiro,

Frank and I used your data to check the program and example with an
independent
algorithm and implementation (Westfall-Young stepdown resampling
procedure). Theory suggests that the
results should be similar to (but not necessarily the same as) those
obtained with multcomp in this special case. These are the adjusted
p-values obtained with the Westfall-Young approach for 100,000
replications:

0.0437
0.0260
0.0204
0.0001

which fit nicely with the ones obtained from multcomp.

Hope this helps & sorry for the delay,

Torsten

> --
> kuroki
> GnuPG fingerprint = 90FD FE79 905F 26F9 29C4  096F 8AA2 2C42 5130 1469
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>




More information about the R-help mailing list