riskratio              package:epitools              R Documentation

_R_i_s_k _r_a_t_i_o _e_s_t_i_m_a_t_i_o_n _a_n_d _c_o_n_f_i_d_e_n_c_e _i_n_t_e_r_v_a_l_s

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

     Calculates risk ratio by unconditional maximum likelihood
     estimation (Wald), and small sample adjustment (small). Confidence
     intervals are calculated using normal approximation (Wald), and
     normal approximation with small sample adjustment (small), and
     bootstrap method (boot).

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

     riskratio(x, y = NULL,
               method = c("wald", "small", "boot"),
               conf.level = 0.95,
               rev = c("neither", "rows", "columns", "both"),
               correction = FALSE,
               verbose = FALSE,
               replicates = 5000)
     riskratio.wald(x, y = NULL,
                    conf.level = 0.95,
                    rev = c("neither", "rows", "columns", "both"),
                    correction = FALSE,
                    verbose = FALSE)
     riskratio.small(x, y = NULL,
                     conf.level = 0.95,
                     rev = c("neither", "rows", "columns", "both"),
                     correction = FALSE,
                     verbose = FALSE)
     riskratio.boot(x, y = NULL,
                    conf.level = 0.95,
                    rev = c("neither", "rows", "columns", "both"),
                    correction = FALSE,
                    verbose = FALSE,
                    replicates = 5000)

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

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

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

  method: method for calculating risk ratio and confidence interval 

conf.level: confidence level (default is 0.95)

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

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

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

replicates: Number of bootstrap replicates (default = 5000) 

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

     Calculates risk ratio by unconditional maximum likelihood
     estimation (Wald), and small sample adjustment (small). Confidence
     intervals are calculated using normal approximation (Wald), and
     normal approximation with small sample adjustment (small), and
     bootstrap method (boot). 

     This function expects the following table struture:


                         disease=0   disease=1
         exposed=0 (ref)    n00         n01
         exposed=1          n10         n11  
         exposed=2          n20         n21
         exposed=3          n30         n31

     The reason for this is because each level of exposure is compared
     to the reference level.

     If you are providing a 2x2 table the following table is preferred:


                         disease=0   disease=1
         exposed=0 (ref)    n00         n01
         exposed=1          n10         n11  

     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's Exact, Monte Carlo simulation, and the
     chi-square test.

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

       x: table that was used in analysis (verbose = TRUE)

    data: same table as 'x' but with marginal totals

p.exposed: proportions exposed (verbose = TRUE)

p.outcome: proportions experienced outcome (verbose = TRUE)

 measure: risk ratio and confidence interval

conf.level: confidence level used (verbose = TRUE)

boot.replicates: number of replicates used in bootstrap estimation of
          confidence intervals (verbose = TRUE)

 p.value: p value for test of independence

mc.replicates: number of replicates used in Monte Carlo simulation p
          value (verbose = TRUE)

correction: logical specifying if 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:

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

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

     Nicolas P. Jewell (2004), Statistics for Epidemiology, 1st
     Edition, 2004, Chapman & Hall, pp. 73-81

     Steve Selvin (1998), Modern Applied Biostatistical Methods Using
     S-Plus, 1st Edition, Oxford University Press

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

     'tab2by2.test', 'oddsratio', 'rateratio', 'epitab'

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

     ##Case-control study assessing whether exposure to tap water
     ##is associated with cryptosporidiosis among AIDS patients

     tapw <- c("Lowest", "Intermediate", "Highest")
     outc <- c("Case", "Control")    
     dat <- matrix(c(2, 29, 35, 64, 12, 6),3,2,byrow=TRUE)
     dimnames(dat) <- list("Tap water exposure" = tapw, "Outcome" = outc)
     riskratio(dat, rev="c")
     riskratio.wald(dat, rev="c")
     riskratio.small(dat, rev="c")

     ##Selvin 1998, p. 289
     sel <- matrix(c(178, 79, 1411, 1486), 2, 2)
     dimnames(sel) <- list("Behavior type" = c("Type A", "Type B"),
                            "Outcome" = c("CHD", "No CHD")
                           )
     riskratio.boot(sel, rev = "b")
     riskratio.boot(sel, rev = "b", verbose = TRUE)
     riskratio(sel, rev = "b", method = "boot")

