epitab               package:epitools               R Documentation

_E_p_i_d_e_m_i_o_l_o_g_i_c _t_a_b_u_l_a_t_i_o_n _f_o_r _a _c_o_h_o_r_t _o_r _c_a_s_e-_c_o_n_t_r_o_l _s_t_u_d_y

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

     Calculates risks, risk ratio, odds ratio, and confidence intervals
     for epidemiologic data

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

     epitab(x, y = NULL,
            method = c("oddsratio", "riskratio", "rateratio"),
            conf.level = 0.95,
            rev = c("neither", "rows", "columns", "both"),           
            oddsratio = c("wald", "fisher", "midp", "small"),
            riskratio = c("wald", "boot", "small"),
            rateratio = c("wald", "midp"),
            pvalue = c("fisher.exact", "midp.exact", "chi2"),
            correction = FALSE,
            verbose = FALSE)

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

       x: For odds ratio or risk ratio, input data can be one of the
          following: r x 2 table, vector of numbers from a contigency
          table (will be transformed into r x 2 table in row-wise
          order), or single factor or character vector that will be
          combined with 'y' into a table.

          For rate ratio, input data can be one of the following: r x 2
          table where first column contains disease counts and second
          column contains person time at risk; a single numeric vector
          of counts followed by person time at risk; a single numeric
          vector of counts combined with 'y' which would be a numeric
          vector of corresponding person time at risk  

       y: For odds ratio or risk ratio, a single factor or character
          vector that will be combined with 'x' into a table (default
          is NULL)

          For rate ratio, a numeric vector of person-time at risk; if
          provided, 'x' must be a numeric vector of disease counts 

  method: select measure of association: "oddsratio" (default),
          "riskratio", or "rateratio" 

conf.level: confidence level (default is 0.95) 

     rev: reverse order of "rows", "colums", "both", or "neither"
          (default) 

oddsratio: selection estimation method: "wald" (default), "fisher",
          "midp", "small"    

riskratio: selection estimation method: "wald" (default), "boot",
          "small" 

rateratio: "wald" (default), "midp" 

  pvalue: "fisher.exact" (default), "midp.exact", "chi2" (normal
          approximation); for rate ratio, "fisher.exact" not calculated            

correction: set to TRUE for Yate's continuity correction (default is
          FALSE) 

 verbose: set to TRUE to return more detailed results (default is
          FALSE) 

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

     The 'epitab' calculates odds ratios, risk ratios, or rate ratios
     for rx2 tables. The odds ratios are estimated using unconditional
     maximum likelihood (Wald), conditional maximum likelihood
     (Fisher), median-unbiased method (mid-p), or small-sample
     adjusted. The confidence intervals are estimated using a normal
     approximation (Wald), hypergeometric exact (Fisher), mid-p exact,
     or small sample adjusted method.

     The risk ratios are estimated using unconditional maximum
     likelihood (Wald), or small-sample adjusted. The confidence
     intervals are estimated using a normal approximation (Wald), or
     bootstrap estimation.

     The rate ratios are estimated using unconditional maximum
     likelihood estimation (Wald), or median unbiased method (mid-p).
     The confidence intervals are estimated using normal approximation,
     or mid-p exact method.

     Notice the expected structure of the data to be given to 'epitab':


                      Disease
       Exposure       No (ref)  Yes
        Level 1 (ref)  a         b
        Level 2        c         d
        Level 3        e         f   

     This function expects the following table struture for rate
     ratios:


                         counts   person-time
         exposed=0 (ref)   n00        t01
         exposed=1         n10        t11    
         exposed=2         n20        t21
         exposed=3         n30        t31

     If the table you want to provide to this function is not in the
     preferred form, just use the 'rev' option to "reverse" the rows,
     columns, or both. If you are providing categorical variables
     (factors or character vectors), the first level of the "exposure"
     variable is treated as the reference. However, you can set the
     reference of a factor using the 'relevel' function.

     Likewise, each row of the rx2 table is compared to the exposure
     reference level and test of independence two-sided p values are
     calculated using fisher exact, mid-p exact, or normal
     approximation method.

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

     tab: primary table

 measure: odds ratio, risk ratio, or rate ratio

conf.level: confidence level

  pvalue: p value method

       x: data input

    data: data with margin totals

p.exposed: proportion exposed

p.outcome: proportion outcome

 p.value: p value

correction: TRUE if Yate's continuity correction was used

_N_o_t_e:

     Visit <URL: http://www.epitools.net> for the latest.

_A_u_t_h_o_r(_s):

     Tomas Aragon, aragon@berkeley.edu, <URL: http://www.medepi.com>

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

     Nicolas P Jewell, Statistics for Epidemiology, 1st Edition, 2004,
     Chapman & Hall 

     Kenneth J. Rothman and Sander Greenland (1998), Modern
     Epidemiology, Lippincott-Raven Publishers

     Kenneth J. Rothman (2002), Epidemiology: An Introduction, Oxford
     University Press

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

     'riskratio', 'oddsratio', 'rateratio'

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

     r243 <- matrix(c(12,2,7,9), 2, 2)
     dimnames(r243) <- list(Diarrhea = c("Yes", "No"),
                           "Antibody level" = c("Low", "High")
                           )
     r243
     r243b <- t(r243)
     r243b
     epitab(r243, rev = "b", verbose = TRUE)
     epitab(r243, method="riskratio",rev = "b", verbose = TRUE)
     epitab(matrix(c(41, 15, 28010, 19017),2,2)[2:1,],
            method="rateratio", verbose = TRUE)

