# OddsRatio

From HH v3.1-8
0th

Percentile

##### Calculate or plot the odds ratio for a 2x2 table of counts.

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.

Keywords
hplot, htest
##### Usage
OddsRatio(x, alpha = 0.05)

plotOddsRatio(x,
ylab="prob(col1 | row1)",
xlab="prob(col1 | row2)",
alpha=c(.50, .05),
##### Value

• 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, p2proportion of each row total observed in the first column.
• omega1, omega2odds for each row, p/(1-p)
• psihatodds ratio, omega2/omega1
• s.ln.psihatstandard deviation of ln(psihat)
• ci.ln.psihatconfidence interval for ln(psihat) using normal approximation
• ci.psihatconfidence interval for psihat calculated ase p(ci.ln.psihat)
• prob1seq(0,1,.05), set of p1 values for plotting.
• odds1p1/(1-p1)
• odds2odds for the second row needed to retain psihat with the specified odds1, calculated as odds1*psihat.
• ci.odds2confidence interval for odds2
• prob2odds2 / (odds2+1)
• ci.prob2ci.odds2 / (ci.odds2+1)

##### References

Heiberger, Richard M. and Holland, Burt (2004b). Statistical Analysis and Data Display: An Intermediate Course with Examples in S-Plus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0-387-40270-5.

##### Aliases
• OddsRatio
• plotOddsRatio
• plotOddsRatio.base
##### Examples
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)
Documentation reproduced from package HH, version 3.1-8, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.