OddsRatio | R Documentation |
Calculate or plot the odds ratio for a 2x2 table of counts. The plot shows the confidence intervals on the probability of row2 for fixed odds ratio and specified probability for row1.
OddsRatio(x, alpha = 0.05)
plotOddsRatio(x,
ylab="prob(col1 | row1)",
xlab="prob(col1 | row2)",
alpha=c(.50, .05),
col=trellis.par.get("superpose.line")$col,
lwd=trellis.par.get("superpose.line")$lwd,
lwd.reference=1,
...)
plotOddsRatio.base(x,
ylab = "prob(col1 | row1)", xlab = "prob(col1 | row2)",
alpha = c(0.05, 0.5),
legend.x=1.05,
oma=c(0,0,0,5), ...)
x |
2 x 2 table of counts |
alpha |
Significance levels of test.
|
xlab , ylab |
x- and y-labels for the plot Sensible defaults are generated. |
col , lwd |
Colors and linewidths to be used in the graph. |
lwd.reference |
linewidth for reference line. |
... |
other arguments, currently ignored. |
legend.x |
x position of left-hand side of legend. |
oma |
outer margin |
plotOddsRatio
returns a lattice object.
The older plotOddsRatio.base
draws a plot with base graphics and invisibly returns the same
list as OddsRatio
returns for the first value of alpha
.
OddsRatio
returns the list:
p1 , p2 |
proportion of each row total observed in the first column. |
omega1 , omega2 |
odds for each row, p/(1-p) |
psihat |
odds ratio, omega2/omega1 |
s.ln.psihat |
standard deviation of |
ci.ln.psihat |
confidence interval for |
ci.psihat |
confidence interval for |
prob1 |
|
odds1 |
|
odds2 |
odds for the second row needed to retain |
ci.odds2 |
confidence interval for |
prob2 |
|
ci.prob2 |
|
Richard M. Heiberger <rmh@temple.edu>
Heiberger, Richard M. and Holland, Burt (2015). Statistical Analysis and Data Display: An Intermediate Course with Examples in R. Second Edition. Springer-Verlag, New York. https://link.springer.com/book/10.1007/978-1-4939-2122-5
data(glasses)
## draw the iso-odds ratio plot with 50% CI and 95% CI,
plotOddsRatio(glasses)
## return the 95% CI information
OddsRatio(glasses)
## draw the iso-odds ratio plot with 50% CI and 95% CI,
## invisibly return the 95% CI information
plotOddsRatio.base(glasses)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.