[R] mantelhaen.test for more than two groups?

Katrin Schweitzer Katrin.Schweitzer at ims.uni-stuttgart.de
Tue Apr 26 18:09:41 CEST 2005


Dear All,

I'd like to perform the generalized Cochran-Mantel-Haenszel-Test (as 
described in Agresti (1990), Categorical Data Analysis) for my nominal data.

My problem is that I have more than two groups. In fact I think I'd need 
an 5-dimensional array for the response variable, the control variable 
and three group variables.
Could you please tell me if this is possible in R - and if yes how I am 
supposed to do this?

By now I get an error message:
 >MyData<-array(c(21,6,0,18,8,1,46,9,2,12,8,1,35,3,7,9,2,8,58,5,11,3,2,4,14,0,0,21,0,0,26,0,0,12,0,0,32,0,0,25,0,0,62,0,0,16,0,0),dim=c(3,2,2,2,2))
 >mantelhaen.test(MyData)
Error in mantelhaen.test(MyData) : x must be a 3-dimensional array
 >

I'm using R Version 1.9.1 on a Linux machine.

I apologize in case I am completely wrong by choosing this test, which 
might be the fact as this is my very first struggle with statistics... :)

In the hope of not losing it,
thank you very much for any help,
:) Kati




More information about the R-help mailing list