Let's call \(D\) a disease, and \(R\) a risc factor. Consider that the probability of presenting the disease in those people having the risk factor (for example smokers, high BMI, etc.) is \(P(D|R)\). For people that are not at risk, this probability is \(P(D|\bar R)\). The relative risk (RR) is defined as: $$RR=\frac{P(D|R)}{P(D|\bar R)}$$

IR RR>1 then the considered factor increments the probability of having the disease. If RR=1, then the probability is not changed by this factor. If RR<1, then the factor reduces the probability of the disease.

In practice, supose you have a group of \(n_1\) exposed people, and \(x_1\) of them present the disease. In a group of \(n_2\) non-exposed people, we observe \(x_2\) with the disease. Then the RR is computed as: $$RR=\frac{x_1/n_1}{x_2/n_2}$$

In order to obtain a CI \((1-\alpha)\)%, we first calculate: $$\sigma=\sqrt{\frac{1}{x_1}-\frac{1}{n_1}+\frac{1}{x_2}-\frac{1}{n_2}}$$ Then we compute: $$(a,b) \rightarrow log(RR) \pm z_{1-\alpha/2}\times \sigma$$ Finally, the desired CI for the RR will be: $$(e^a,e^b)$$

Supose that we have 35 exposed and 45 non-exposed. The cases are 25 and 22 in each group. Then: $$p_1=25/35$$ $$p_2=22/45$$ $$\sigma=\sqrt{\frac{1}{25}-\frac{1}{35}+\frac{1}{22}-\frac{1}{45}}=0.186$$ $$(a,b) \rightarrow log((25/35)/(22/45)) \pm 1.96 \times 0.186 \rightarrow (0.01,0.74)$$ $$95\% CI \rightarrow (e^{0.01},e^{0.74}) \rightarrow (1.01,2.10)$$

In this application, you can introduce the size and the observed cases in both a exposed and non exposed group.

The exposed group can correspond to an experimental group reciving some treatment or to a cohort of people that share some risk condition (genetic, social, ambiental, etc.)

The non exposed group is used as a control and are people that are not treated or the do not have the risk condition

The relative risk is estimated by its corresponding 95% confidence interval

More on relative risk (wikipedia)