Why Work on the Log Scale?
A relative risk compares the risk of an outcome in one group with the risk in another. Because it is a ratio, its values are positive, and equal risks correspond to a relative risk of 1. An interval centered symmetrically around a relative risk on its original scale could extend below zero, which is not possible for a ratio. A useful alternative is to construct an interval for the logarithm of the relative risk, where a normal approximation is convenient, and then exponentiate the two limits.
This tutorial develops that interval from the two independent Bernoulli groups model. The result is an approximate confidence interval: its reliability depends on the data being adequate for the normal approximation, especially on having enough outcome events in both groups.
Definition and Model
The group labels must be kept consistent: group 1 is the numerator throughout, and group 2 is the denominator. For example, if group 1 is a treatment group and group 2 is a comparison group, a relative risk greater than 1 means the estimated outcome risk is higher in the treatment group. Reversing the groups changes the relative risk to its reciprocal.
The model assumes that each group consists of independent binary outcomes with a common risk within that group: the outcomes in group 1 follow Bernoulli distributions with probability \(p_1\), and those in group 2 follow Bernoulli distributions with probability \(p_2\). The two groups are independent of each other. These assumptions fit, for example, two independently sampled groups or a randomized study with independent participants. The sampling or study design must also support inference to the populations of interest. If the data are observational, a relative risk describes an association and does not, by itself, establish a causal effect.
Deriving the Approximate Standard Error
The interval is built for \(\log(\widehat{RR})\). The logarithm turns a ratio into a difference:
For a sample proportion from a group of size \(n_i\), the Bernoulli model gives \(\operatorname{Var}(\hat{p}_i)=p_i(1-p_i)/n_i\). When the sample is large enough for a first-order normal approximation, a first-order Taylor expansion of \(\log(x)\) around \(p_i\) uses derivative \(1/p_i\). Thus the approximate variance of \(\log(\hat{p}_i)\) is the variance of \(\hat{p}_i\) multiplied by the squared derivative:
The population risks are unknown, so they are replaced by their sample estimates. Since the two groups are independent, the variances of the two log sample proportions add when forming their difference. Using \(a=n_1\hat{p}_1\) and \(c=n_2\hat{p}_2\) gives the estimated variance and standard error:
This expression is an estimate of uncertainty on the log relative risk scale, not the relative-risk scale. It is defined only when both groups have at least one outcome event, so that \(a>0\) and \(c>0\).
Constructing and Transforming the Interval
When the normal approximation is reasonable, the standardized log estimate is approximately standard normal. For a confidence level of \(100(1-\alpha)\%\), let \(z^*\) be the positive standard normal critical value with central probability \(1-\alpha\). The interval on the log scale is the estimate plus and minus \(z^*\) standard errors. Because the exponential function is increasing, exponentiating both limits gives the interval for \(RR\):
The log-scale interval is symmetric around \(\log(\widehat{RR})\), but exponentiation generally makes the ratio-scale interval asymmetric around \(\widehat{RR}\). Its limits remain positive, as relative risks must. If the upper log limit is the negative of the lower log limit after centering, the corresponding multiplicative distances on the ratio scale are reciprocal factors, not equal additive distances.
Worked Example: A 95% Interval for a Higher Estimated Risk
Suppose a hypothetical study compares an exposed group with an unexposed group. The outcome occurs in 36 of 120 exposed participants and 18 of 150 unexposed participants. Treat the groups as independent, and suppose participants within each group can reasonably be modeled as independent Bernoulli outcomes with a common risk. The event and non-event counts are 36 and 84 in the exposed group, and 18 and 132 in the unexposed group, so neither group has a boundary sample proportion.
The sample risks and relative risk are
The log estimate is \(\log(2.500)=0.9163\). The estimated standard error is
For 95% confidence, the log-scale limits are
Exponentiating each limit gives
The approximate 95% confidence interval is therefore 1.50 to 4.17. In this hypothetical setting, the data are consistent with the exposed group's outcome risk being about 1.50 to 4.17 times the unexposed group's risk, under the model and sampling assumptions. This is an interval for a population relative risk, not a statement that there is a 95% probability the fixed population parameter lies in this particular interval.
Worked Example: A Relative Risk Below One
In another hypothetical comparison, 24 of 200 participants in group 1 and 40 of 250 participants in group 2 experience an outcome. Assume independent groups and independent Bernoulli outcomes within each group. There are 24 and 40 events and 176 and 210 non-events, respectively, so the proportions are not at a boundary.
The estimated risks and relative risk are
The log estimate is \(\log(0.7500)=-0.2877\). Its estimated standard error is
For a 95% interval, the log-scale endpoints are
After exponentiating,
The approximate 95% confidence interval is 0.468 to 1.20. The point estimate indicates a lower observed risk in group 1 than in group 2, but the interval includes relative risk 1. The interval therefore includes equal population risks among the values reasonably compatible with the data and model; it does not support a precise conclusion that group 1 has lower risk.
Worked Example: Using a 90% Confidence Level
Consider hypothetical independent groups with 50 outcome events among 200 participants in group 1 and 20 events among 160 participants in group 2. Assume the Bernoulli model applies within each group. The event and non-event counts are 50 and 150 in group 1, and 20 and 140 in group 2, providing positive counts for both outcomes in both groups.
The relative risk estimate is
The log estimate is \(\log(2)=0.6931\). Its standard error is
For a 90% confidence interval, use \(z^*=1.645\). The log-scale endpoints are
Thus, the ratio-scale interval is
The approximate 90% confidence interval is 1.34 to 2.98. In context, the population risk in group 1 is estimated to be between 1.34 and 2.98 times the risk in group 2, with the stated confidence procedure and its assumptions. A 90% interval is narrower than a 95% interval from the same data because it uses a smaller critical value.
Conditions and Interpretation
Before interpreting a log-relative-risk interval, check the model and the approximation rather than relying on the formula alone.
- Binary outcome and defined groups: Each observation is classified as having or not having the outcome, and the group risks refer to clearly defined populations or study groups.
- Independent observations: Outcomes are independent within each group, and the two groups are independent. Dependence, such as repeated measurements on the same participant, is not handled by this formula.
- Positive event counts: Both \(a\) and \(c\) must be greater than zero for the log estimate and its standard error to be defined.
- Reasonable normal approximation: The event counts and non-event counts should be sufficiently large for the sample proportions and their logarithms to be approximated adequately by normal distributions. Having only a few events can make this interval unreliable even though the arithmetic can be carried out.
A confidence level describes the long-run performance of the method: over repeated samples satisfying the model, approximately 95% of intervals constructed by the 95% procedure would contain the population relative risk. After an interval is calculated, the population relative risk is fixed; the confidence level is not the probability that this one interval contains it. The endpoints are relative risks, so they have no physical units. The risks used to form them may have units such as a proportion of participants, but those units cancel in their ratio.
Common Mistakes and Why the Interval Matters
The logarithmic construction is useful because it gives a practical approximate interval that respects the positive scale of a ratio. It also makes clear what the uncertainty calculation concerns: the relative risk is estimated on one scale, its standard error is calculated on the log scale, and its interval is reported on the original ratio scale.
- Using an ordinary proportion-difference standard error. A relative risk is a ratio, so its log standard error uses the event counts and group sizes in the formula above. It is not the standard error for \(\hat{p}_1-\hat{p}_2\).
- Exponentiating the estimate but not the endpoints. The interval must be calculated on the log scale and then both endpoints exponentiated. The confidence limits are not \(\widehat{RR}\pm z^*SE\).
- Expecting equal additive distances on the ratio scale. The log limits are symmetric around \(\log(\widehat{RR})\); their exponentiated limits are usually not symmetric around \(\widehat{RR}\).
- Treating a zero event count as a routine case. If either event count is zero, the log estimate and this standard error formula are undefined. This method cannot be applied as written.
- Overstating what the comparison establishes. An interval estimates a population ratio under its assumptions. In observational data, it does not establish that group membership caused the difference in risks.
Check Your Understanding
Use the definitions and interval construction above to answer these questions.
- In a study with \(a=30\), \(n_1=150\), \(c=20\), and \(n_2=200\), write the estimated relative risk and its log-scale standard error formula using the counts.
- Why does the confidence interval get constructed for \(\log(\widehat{RR})\) before the endpoints are transformed back?
- What does a 95% confidence level mean in terms of repeated samples and intervals?
- If the interval on the relative-risk scale is 0.70 to 1.40, explain what the inclusion of 1 means for the range of population relative risks compatible with the interval.
- What happens to this method if group 2 has zero observed events, and why?