第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

Risk Ratio 和 Odds Ratio

標(biāo)簽:
Python 數(shù)學(xué)

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:

Risk Ratio (Relative Risk)= P(event in group1)/P(event in group 2)

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.

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())
#Output
Censor      0   1
Treatment        
Placebo    29  14
Treated    13  28


 Estimate   SE   LCB   UCB   p-value
--------------------------------------------------
Odds ratio        4.462       1.785 11.154   0.001
Log odds ratio    1.495 0.467 0.579  2.412   0.001
Risk ratio        2.127       0.579  2.412   0.003
Log risk ratio    0.755 0.253 0.260  1.250   0.003
--------------------------------------------------
#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.

Odds in Placebo=2914Odds\ in \ Placebo= \frac{29}{14}

Odds in Treatment=1328Odds \ in \ Treatment= \frac{13}{28}

Risk Ratio=2.07140.464=4.46Risk \ Ratio = \frac{2.0714}{0.464}=4.46

Risk Ratio means the probability of an event occurring in group 1 compared to the probability of the same event occurring in group 2.

P(censor=0 in Placebo)=2943P(censor=0 \ in \ Placebo)= \frac{29}{43}

P(censor=0 in Treatment)=1341P(censor=0 \ in \ Treatment)= \frac{13}{41}

Risk Ratio=0.6740.317=2.127Risk \ Ratio = \frac{0.674}{0.317}=2.127

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!

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報(bào)

0/150
提交
取消