oddsratio {vcd}R Documentation

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:

ASE a vector with the asymptotic standard errors
lwr, upr a vector with lower/upper confidence bounds
Z test statistic for significance tests (only computed for log odds ratios: simply the standardized log odds ratio, which follows an asymptotic normal distribution.
P p-value for this test.
log logical value indicating if log odds ratios or common odds ratios are computed.

Note

The summary method prints the standard errors.

Author(s)

David Meyer
david.meyer@ci.tuwien.ac.at

References

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

See Also

plot.oddsratio

Examples

data(CoalMiners)
summary(oddsratio(CoalMiners))

[Package vcd version 0.1-3.5 Index]