Learn R Programming

vcd (version 0.1-3.5)

plot.oddsratio: (Log) Odds Ratios Plots

Description

Plots (log) odds ratios, computed by oddsratio for 2 x 2 x k-tables, along with confidence intervals.

Usage

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

Arguments

x
An object of class logoddsratio, computed for a 2 x 2 x k-table.
confidence
if TRUE, confidence intervals are plotted for each data point.
type
plot type.
ylab
label for the y-axis. The default results in "Odds Ratio" or "Log Odds Ratio", as appropriate.
xlab
label for the x-axis.
whiskers
Width of the confidence interval whiskers.
...
Other graphics parameters (see par).

References

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

See Also

oddsratio

Examples

Run this code
data(CoalMiners)
l <- oddsratio(CoalMiners)
g <- seq(25, 60, by = 5)
plot(l,
     xlab = "Age Group",
     main = "Breathelessness and Wheeze in Coal Miners")
m <- lm(l ~ g + I(g^2))
lines(fitted(m), col = "red")

Run the code above in your browser using DataLab