Confidence Interval for an Odds Ratio
Note that while we have discussed using the odds ratio as a measure of association in the context of a casecontrol study, odds ratios can also be computed in other types of study designs as well. Recall our example of a prospective cohort study to examine the association of hypertension and cardiovascular disease. In this study the risk ratio was RR=2.18, but we can also compute an odds ratio and then use these data to illustrate how to compute a confidence interval for an odds ratio.
Table  Association Between Hypertension (HTN) and Cardiovascular Disease (CVD)
CVD 
No CVD 
Total 

HTN 
992 
2260 
3252 
No HTN 
165 
1017 
1182 
Total 
1157 
3277 
4434 
Just as we noted for risk ratios, odds ratios are also not normally distributed. They too are skewed toward the upper end of possible values. As a result, we must once again take the natural log of the odds ratio and first compute the confidence limits on a logarithmic scale, and then convert them back to the normal odds ratio scale.
The formula for the 95% Confidence Interval for the odds ratio is as follows:
The standard error for log(OR) is computed using the following equation:
We will illustrate computation of a 95% confidence interval for the data in the contingency table shown above.
 Step 1: Calculate the natural log of the risk ratio using R.
> log(2.71)
[1] 0.9969486
 Step 2: Calculate the standard error of the log(OR)
 Step 3: Calculate the lower and upper confidence bounds on the natural log scale
 Step 4: Convert the log limits back to a normal scale for odds ratios by taking the antilog using R.
> exp(0.816)
[1] 2.261436
> exp(1.178)
[1] 3.247872
Interpretation: In this study, subjects with hypertension 2.71 times the odds of developing cardiovascular disease compared to nonhypertensive subjects. With 95% conficence the true odds ratio lies in the range of 2.263.24.