Skip to content
Prev 169784 / 398506 Next

R equivalent of SAS Cochran-Mantel-Haenszel tests?

Dear Michael,
It sounds as a linear-by-linear loglinear model (and its variants) which 
uses scores for one or more variables in the table.. (see Agresti, 1990, 
Categorical Data Analysis. I do remember the pages and I have not the 
book here..)

If this is the case, you can use standard call to glm(.., 
family=poisson) with score variables in the linear predictor. For 
instance for a two-way table with ordered variables the linear-by-linear 
model is,

glm(freq~factor(x)+factor(y)+I(score.x*score.y), family=poisson)

The CMH test, probably, is the score test of the parameter of 
I(score.x*score.y)..

best,
vito

Michael Friendly ha scritto: