oddsratio                package:vcd                R Documentation

(_L_o_g) _O_d_d_s _R_a_t_i_o_s

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

     Computes (log) odds ratios and their asymptotic standard errors
     for (possibly) stratified data.

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

     oddsratio(x, stratum = NULL, log = TRUE)
     ## S3 method for class 'oddsratio':
     plot(x, conf_level = 0.95, type = "o",
       xlab = "Strata", ylab = NULL, ylim = NULL, whiskers = 0.1, ...)

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

       x: a 2 by 2 by ... table.

 stratum: vector of strata dimensions.

     log: if 'FALSE', ordinary odds ratios are computed.

conf_level: if not 'NULL' or 'FALSE', 'conf_level'-% confidence
          intervals are plotted for each data point.

    type: plot type.

    xlab: label for the x-axis.

    ylab: label for the y-axis.

    ylim: y-axis limits.

whiskers: width of the confidence interval whiskers.

     ...: other graphics parameters (see 'par').

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

     An object of class '"logoddsratio"', which is simply a vector of
     (log) odds ratios with dimensionality depending on 'stratum',
     along with the following attributes: 

     ASE: a numeric vector with the asymptotic standard errors.

     log: logical indicating whether log odds ratios or common odds
          ratios are computed.

_N_o_t_e:

     The 'summary' method prints the standard errors and-for log odds
     ratios-also computes and prints asymptotic z tests (standardized
     log odds ratios) and the corresponding p values.

     There is a 'confint' method for computing confidence intervals for
     the (log) odds ratios.

     The 'plot' method plots (log) odds ratios, computed by 'oddsratio'
     for 2 x 2 x k tables, along with confidence intervals.

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

     David Meyer David.Meyer@R-project.org

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

     M. Friendly (2000), _Visualizing Categorical Data_. SAS Institute,
     Cary, NC.

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

     'confint'

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

     ## load Coal Miners data
     data(CoalMiners)

     ## compute log odds ratios
     lor <- oddsratio(CoalMiners)
     lor

     ## summary with z tests
     summary(lor)

     ## confidence intervals
     confint(lor)

     ## visualization
     plot(lor,
          xlab = "Age Group",
          main = "Breathelessness and Wheeze in Coal Miners")

     ## add quadratic model
     g <- seq(25, 60, by = 5)
     m <- lm(lor ~ g + I(g^2))
     lines(fitted(m), col = "red")

