Calculating lift & significance testing

Analyzing Marketing Campaigns with pandas

Jill Rosok

Data Scientist

Treatment performance compared to the control

shutterstock_570239977.jpg

Calculating lift:

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

Analyzing Marketing Campaigns with pandas

Calculating lift

# 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%
Analyzing Marketing Campaigns with pandas

T-distribution

overlapping t distributions

1 Identification of Timed Behavior Models for Diagnosis in Production Systems. Scientific Figure on ResearchGate.
Analyzing Marketing Campaigns with pandas

P-values

  • T-statistic of 1.96 is typically statistically significant at the 95% level
  • Depending on the context of the test, you may be comfortable with a lower or higher level of statistical significance.
Analyzing Marketing Campaigns with pandas

T-test in Python

from scipy.stats import ttest_ind

t = ttest_ind(control, personalized)

print(t)
Ttest_indResult(statistic=-2.7343299447505074, 
                pvalue=0.006451487844694175)


Analyzing Marketing Campaigns with pandas

Let's practice!

Analyzing Marketing Campaigns with pandas

Preparing Video For Download...