epitable              package:epitools              R Documentation

_C_r_e_a_t_e _r _x _c _c_o_n_t_i_g_e_n_c_y _t_a_b_l_e (_e_x_p_o_s_u_r_e _l_e_v_e_l_s _v_s. _b_i_n_a_r_y _o_u_t_c_o_m_e)

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

     Create r x c contigency table for r exposure levels and c outcome
     levels

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

     epitable(..., ncol =2, byrow = TRUE,
              rev = c("neither", "rows", "columns", "both"))

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

     ...: see details

    ncol: number of columns = 2 (default) when a table is constructed
          from a vector or sequence of numbers  

   byrow: Default is TRUE and single vector or collection of numbers is
          read in row-wise. Set to FALSE to read in column-wise.

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

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

     Creates r x 2 table with r exposure levels and 2 outcome levels
     (No vs. Yes). Arguments can be one of the following:

     (1) four or more integers that be converted into r x 2 table (the
     number of integers must be even),

     (2) two categorical vectors (1st vector is exposure with r levels,
     2nd vector is outcome with 2 levels), 

     (3) r x 2 contingency table, or

     (4) single vector that be converted into r x 2 table (the number
     of integers must be even).

     The contingency table created by this function is usually used for
     additional analyses, for example, the 'epitab' function.

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

     Returns r x 2 contingency table, usually for additional analyses.

_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:

     none

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

     'epitable'

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

     ## single vector
     dat <- c(88, 20, 555, 347)
     epitable(dat)

     ## 4 or more integers
     epitable(1,2,3,4,5,6)

     ## single matrix
     epitable(matrix(1:6, 3, 2))

     ## two categorical vectors
     exposure <- factor(sample(c("Low", "Med", "High"), 100, rep=TRUE),
                        levels=c("Low", "Med", "High"))
     outcome <- factor(sample(c("No", "Yes"), 100, rep=TRUE))
     epitable(exposure, outcome)
     epitable("Exposure"=exposure, "Disease"=outcome)

     ## reversing row and/or column order
     zz <- epitable("Exposure Level"=exposure, "Disease"=outcome)
     zz
     epitable(zz, rev = "r")
     epitable(zz, rev = "c")
     epitable(zz, rev = "b")

