Case Study2 min read

Increasing average bill AB test

Automated conversion of classic_rct_average_bill.ipynb

Increasing average bill AB test

We run a website that sells construction tools. The owner wants to add an option to buy an extended warranty for tools. This is a new paid add-on shown as an extra payment button on the checkout page.

We split users into two groups:

  • Control: users who do not see the new payment button

  • Treatment: users who see the new payment button

We will test hypothesis:

HoH_o - There is no difference in an average bill between treatment and control groups.

HaH_a - There is a difference in an average bill between treatment and control groups.

Data

We will use DGP from causalis

Result
user_idydplatform_ioscountry_usasource_paidagecnt_transplatform_Androidplatform_iOSinvited_friend
000c0162.0150010.01.00.01.0390010
1014d722.3531861.00.00.01.0464010
201daa38.2131000.01.01.00.0361100
3012b977.9270951.01.01.00.0262010
400e7b24.9360851.00.01.00.0353010
Result

CausalData(df=(10000, 6), treatment='d', outcome='y', confounders=['platform_ios', 'country_usa', 'source_paid'], user_id='user_id')

Result
treatmentcountmeanstdminp10p25medianp75p90max
00.0495545.27122836.1850630.33838011.08153020.32660235.78425460.06395889.576241431.357219
11.0504550.32888338.8027100.44825512.33552122.79290041.14939667.409299100.121519401.883422
Result

png

Result
treatmentnoutlier_countoutlier_ratelower_boundupper_boundhas_outliersmethodtail
00.049552060.041574-39.279431119.669992Trueiqrboth
11.050451930.038256-44.131698134.333897Trueiqrboth

Monitoring

Our system is randomly splitting users. Half of them must have new onboarding, other half has not. We should monitor the split with SRM test. Read more at https://causalis.causalcraft.com/articles/srm

Result

SRMResult(status=no SRM, p_value=0.36812, chi2=0.8100)

Check the confounders balance

Are groups equal in terms of confounders? We need to choose with domain and business sense confounders and check balance of them. The standard benchmark:

  • SMD>0.1SMD > 0.1
  • ks_pvalue < 0.05
Result
confoundersmean_d_0mean_d_1abs_diffsmdks_pvalue
0source_paid0.2990920.3137760.0146840.0318530.64592
1platform_ios0.4940460.5028740.0088280.0176540.98861
2country_usa0.5862760.5918730.0055970.0113741.00000

As we see system splitted users randomly

Estimation with Diff-in-Means

Result
value
field
estimandATE
modelDiffInMeans
value5.0577 (ci_abs: 3.6104, 6.5552)
value_relative11.1719 (ci_rel: 7.7490, 14.5948)
alpha0.0500
p_value0.0000
is_significantTrue
n_treated5045
n_control4955
treatment_mean50.3289
control_mean45.2712
time2026-02-12

Executive summary

We observed a statistically significant increase in average order value from 45.2 to 50.3 dollars (+ 5.06). The 95% confidence interval for the absolute lift is [3.59, 6.51].

The decision is whether to roll out this change (scale it to all users).