Learn R Programming

vcd (version 0.1-3.5)

oddsratio: Odds Ratios

Description

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

Usage

oddsratio(x, stratum = NULL, log = TRUE, conf.level = 0.95)

Arguments

x
a 2 x 2 x ... table.
stratum
vector of strata dimensions.
log
if FALSE, ordinary odds ratios are computed
conf.level
confidence level used for confidence intervals.

Value

  • An object of class logoddratio, which is simply a vector of (log) odds ratios with dimensionality depending on stratum, along with the following attributes:
  • ASEa vector with the asymptotic standard errors
  • lwr, upra vector with lower/upper confidence bounds
  • Ztest statistic for significance tests (only computed for log odds ratios: simply the standardized log odds ratio, which follows an asymptotic normal distribution.
  • Pp-value for this test.
  • loglogical value indicating if log odds ratios or common odds ratios are computed.

References

M. Friendly (2000), Visualizing Categorical Data. SAS Institute, Cary, NC.

See Also

plot.oddsratio

Examples

Run this code
data(CoalMiners)
summary(oddsratio(CoalMiners))

Run the code above in your browser using DataLab