[R] contrast matrix in package multcomp

Sven Garbade garbade at psy.uni-muenchen.de
Wed Jun 26 17:52:20 CEST 2002


Hi,

I've got a problem building a contrast matrix for the Dunnet contrast in
package multcopm. The following works fine:

> summary(simtest(adiff ~ trial))

  Simultaneous tests: Dunnett contrasts

Data:  adiff by trial

Contrast matrix:
              trial1 trial2 trial3 trial4 trial5
trial2-trial1     -1      1      0      0      0
trial3-trial1     -1      0      1      0      0
trial4-trial1     -1      0      0      1      0
trial5-trial1     -1      0      0      0      1


Absolute Error Tolerance:  0.001

Coefficients:
              Estimate t value Std.Err. p raw p Bonf p adj
trial3-trial1    0.745  -2.911    0.256 0.006  0.025 0.021
trial2-trial1   -0.688  -2.686    0.256 0.011  0.033 0.029
trial4-trial1    0.091  -0.357    0.256 0.724  1.447 0.912
trial5-trial1    0.032  -0.127    0.256 0.900  1.447 0.912

But now I want to test trial3 against all other trials and build the
following contrast matrix C:

> C
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    0   -1    0    0
[2,]    0    1   -1    0    0
[3,]    0    0   -1    1    0
[4,]    0    0   -1    0    1

but I got the error:

> summary(simtest(adiff ~ trial, cmatrix=C))
Error in simtest.formula(adiff ~ trial, cmatrix = C) :
 dimensions of x and cmatrix do not match

Does anybody know what went wrong?

Thanks, Sven

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list