計算提升率與顯著性檢定

使用 pandas 分析行銷活動

Jill Rosok

Data Scientist

與控制組相比的處置組表現

shutterstock_570239977.jpg

計算提升率:

$$ \frac{\text{Treatment conversion rate - Control conversion rate}}{\text{Control conversion rate}} $$

使用 pandas 分析行銷活動

計算提升率

# Calcuate the mean of a and b 
a_mean = np.mean(control)
b_mean = np.mean(personalization)

# Calculate the lift using a_mean and b_mean
lift = (b_mean-a_mean)/a_mean

print("lift:", str(round(lift*100, 2)) + '%')
lift: 194.23%
使用 pandas 分析行銷活動

t 分配

重疊的 t 分配

1 Identification of Timed Behavior Models for Diagnosis in Production Systems. Scientific Figure on ResearchGate.
使用 pandas 分析行銷活動

P 值

  • t 統計量 1.96 通常在 95% 顯著水準下具有統計顯著性。
  • 視情境而定,你可以接受較低或較高的顯著水準。
使用 pandas 分析行銷活動

在 Python 中進行 t 檢定

from scipy.stats import ttest_ind

t = ttest_ind(control, personalized)

print(t)
TtestResult(statistic=-2.7343299447505074, 
            pvalue=0.006451487844694175, 
            df=552.0)

使用 pandas 分析行銷活動

一起來練習吧!

使用 pandas 分析行銷活動

Preparing Video For Download...