Message-ID: <Pine.A41.4.61b.0504260906580.131934@homer03.u.washington.edu>
Date: 2005-04-26T16:08:07Z
From: Thomas Lumley
Subject: mantelhaen.test for more than two groups?
In-Reply-To: <426E67C5.5080202@ims.uni-stuttgart.de>
On Tue, 26 Apr 2005, Katrin Schweitzer wrote:
> 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?
You're supposed to have a three-dimensional array: exposure x response x
group.
This means turning your three group variables into one variable. One way
to do this is with the interaction() function.
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle