[R] Computing a Mantel-Haenszel chi-square using a continuous variable as the matching criterion

Peter Dalgaard pdalgd at gmail.com
Thu Oct 7 22:41:48 CEST 2010


On 10/07/2010 08:24 PM, David Winsemius wrote:
> 
> On Oct 7, 2010, at 2:21 PM, Barth B. Riley wrote:
> 
>> Dear list
>>
>> I would like to compute a Mantel-Haenszel chi-square in which the  
>> matching variable is a continuous variable. The MH chi-square is  
>> used to assess the relationship between two categorical variables at  
>> each level or strata defined by a third variable. Specifically I  
>> would like to know if there is a straightforward way to divide the  
>> matching variable into levels, in which each level has a minimum of  
>> 20 cases. Any information would be greatly appreciated.
> 
> Why? What makes you think matching would be valuable? (...or even  
> valid, for that matter.)

What makes you think he has a choice? Matching is generally part of the
design and data may already have been collected...

For small-strata analyses look at clogit() in survival package. For
cutting a continuous variable into roughly equal-sized strata use a
combination og  cut() and quantile() or (AFAIR) cut2() from one of Frank
Harrell's packages. Finally, Breslow+Day in their classic book on
case-control studies suggest replacing matched analysis by ordinary
logistic regression with the effect of the matching variable modeled by
a suitably high-order polynomial.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list