How about using logistic regression? When you have K dimensional tables and several potential confounders it might be better to go for a multivariable model. Take a look at function glm(stats) and lrm(Design).

Cheers

Francisco

From: Peter Dalgaard <[EMAIL PROTECTED]>
To: Thomas Lumley <[EMAIL PROTECTED]>
CC: Katrin Schweitzer <[EMAIL PROTECTED]>, [email protected]
Subject: Re: [R] mantelhaen.test for more than two groups?
Date: 26 Apr 2005 18:24:31 +0200


Thomas Lumley <[EMAIL PROTECTED]> writes:

> 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.

Or, if data are already counts, change the dimensions (as in dim(x) <-
c(2,3,8)), possibly after using aperm() to get the indices in the
right order.

--
   O__  ---- Peter Dalgaard             Blegdamsvej 3
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])             FAX: (+45) 35327907

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to