Data Science Day 15
Risk Ratio
Last time, we give a SAS example of Risk Difference to test if two groups are experiencing the same proportion of a certain event. In order to understand the topic better, we will go over Risk Ratio.
Definition:
Risk Ratio or Relative Risk (RR) is the probability that an event occurs in a group 1 relative to the probability that the same event occurs in group 2.
Note: Without Loss of Generality, In clinical trials, we take a group to be actual treatment group and the other group is the placebo group.
Formula:
Interpretation:
RR ≈ 1 ⇒ The proportion of events are similar in group 1 and group 2.
RR » 1 ⇒ Increased probability of events among those in group 1 compared to group 2.
RR « 1 ⇒ Decreased probability of events among those in group 1 compared to group 2.
Note: This is a general interpretation, we can explain in different scenarios.
For example:
1. In Cancer study, if the event represents death, and group 1 is the Drug Treatment. Then we would expect Risk Ratio « 1.
2. In Cancer Study, if the event represents Complete Response, which means the tumor disappear, then we would expect Risk Ratio » 1.

Mediamodifier / Pixabay
Example:
#Import Library import numpy as np import pandas as pd import statsmodels.api as sm import pylab as pl import matplotlib.pyplot as plt import seaborn as sns
#Read in Arthritis data df = sm.datasets.get_rdataset("Arthritis", "vcd").data #Create New variable Censor: #Censor=0 means no-improvement #Censor=1 means some or big improvement df["Censor"]=np.where(df["Improved"]=="None", "0", "1") #table for Treatment and Censor tab=pd.crosstab(df["Treatment"], df["Censor"]) tab1=sm.stats.Table(tab) print(tab1.table_orig) table= np.asarray([[29,14],[13,28]]) t22=sm.stats.Table2x2(table) print(t22.summary())
#Visulatization %matplotlib inline pd.crosstab(df.Treatment, df.Censor).plot(kind="bar") plt.title("Treatment vs Placebo") plt.xlabel("Treatment Type for Arthritis") plt.ylabel("Censor Status")
Summary
- Censor=0, Arthritis problem remains
- Censor=1, Arthritis problem improved
Odds Ratio
Odds Ratio= 4.462, this implies in Placebo Group has 4.5 times more likely to remain the Arthritis problem compared to the Treatment Group.
Risk Ratio
Risk Ratio=2.127 means in Placebo Group the probability of patients’ Arthritis problem remains increased compared to the Patients in Treatment Group.
Connections:
It is very easy to mix the concept for Odds Ratio and Risk Ratio.
Odds Ratio represents the odds of an event in group 1 compared to the event of odds in group 2, where odds means the event over non-event.
Risk Ratio means the probability of an event occurring in group 1 compared to the probability of the same event occurring in group 2.
Conclusion:
Risk ratio compares the probability of the occurrence of the same event in two groups. In addition, we can use the Risk Difference to check if the two groups have the same Risk Ratio.
Happy Studying! 🤡