mh                    package:Epi                    R Documentation

_M_a_n_t_e_l-_H_a_e_n_s_z_e_l _a_n_a_l_y_s_e_s _o_f _c_o_h_o_r_t _a_n_d _c_a_s_e-_c_o_n_t_r_o_l _s_t_u_d_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function carries out Mantel-Haenszel comparisons in tabulated
     data  derived from both cohort and case-control studies. Multiway
     tables of data are accepted and any two levels of any dimension
     can be chosen as defining the comparison groups. The rate (odds)
     ratio estimates and the associated significance tests may be
     collapsed over all the remaining dimensions of the  table, or over
     selected dimensions only (so that tables of estimates and  tests
     are computed).

_U_s_a_g_e:

     mh(cases, denom, compare=1, levels=c(1, 2), by=NULL,
          cohort=!is.integer(denom), confidence=0.9)

_A_r_g_u_m_e_n_t_s:

   cases: the table of case frequencies (a multiway array). 

   denom: the denominator table. For cohort studies this should be a
          table of  person-years observation, while for case-control
          studies it should be a  table of control frequencies.  

 compare: the dimension of the table which defines the comparison
          groups (can be  referred to either by number or by name). The
          default is the first  dimension of the table. 

  levels: a vector identifying (either by number or by name) the two
          groups to be  compared. The default is the first two levels
          of the selected dimension. 

      by: the dimensions not to be collapsed in the Mantel-Haenszel
          computations.  Thus, this argument defines the structure of
          the resulting tables of estimates and tests.   

  cohort: an indicator  whether the data derive from a cohort or a
          case-control  study. If the denominator table is stored as an
          integer, a case-control study is assumed. 

confidence: the approximate coverage probability for the confidence
          intervals to be  computed. 

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     A list giving tables of rate (odds) ratio estimates, their
     standard errors  (on a log scale), lower and upper confidence
     limits, chi-squared tests  (1 degree of freedom) and the
     corresponding p-values. The result list also  includes numerator
     and denominator of the Mantel-Haenszel estimates (q, r),  and
     score test statistics and score variance (u, v).

_S_i_d_e _E_f_f_e_c_t_s:

     None

_R_e_f_e_r_e_n_c_e_s:

     Clayton, D. and Hills, M. : Statistical Models in Epidemiology,
     Oxford  University Press (1993).

_S_e_e _A_l_s_o:

     'Lexis'

_E_x_a_m_p_l_e_s:

     # If d and y are 3-way tables of cases and person-years 
     # observation formed by tabulation by two confounders 
     # (named "C1" and "C2") an exposure of interest ("E"), 
     # the following command will calculate an overall 
     # Mantel-Haenszel comparison of the first two exposure 
     # groups.
     #
     # Generate some bogus data
     dnam <- list( E=c("low","medium","high"), C1=letters[1:2], C2=LETTERS[1:4] )
     d <- array( sample( 2:80, 24),
                 dimnames=dnam, dim=sapply( dnam, length ) )
     y <- array( abs( rnorm( 24, 227, 50 ) ),
                 dimnames=dnam, dim=sapply( dnam, length ) )
     mh(d, y, compare="E")
     #
     # Or, if exposure levels named "low" and "high" are to be 
     # compared and these are not the first two levels of E :
     #
     mh(d, y, compare="E", levels=c("low", "high"))
     #
     # If we wish to carry out an analysis which controls for C1, 
     # but examines the results at each level of C2:
     #
     mh(d, y, compare="E", by="C2")
     #
     # It is also possible to look at rate ratios for every 
     # combination of C1 and C2 :
     #
     mh(d, y, compare="E", by=c("C1", "C2"))
     #
     # If dimensions and levels of the table are unnamed, they must 
     # be referred to by number.
     #

