2
$\begingroup$

I've been asked to compute the minimum sample size for an AB test that my company is conducting for a tweaked recommender system.

  • We will choose two groups of users, one of which sees only the A version and one of which sees only the B version of their recommendations.
  • We will compute conversion rate as the number of times users choose items from their recommendations divided by the number of times they view their recommendations.
  • Many users won't view their recommendations at all during the test period while some users will view their recommendations dozens of times.

Question:

Should we calculate the overall conversion rate for each group and compare using a two-proportion Z-test?

Or should we calculate the conversion rate for each user who viewed their recommendations at least once and compare the average of the individual conversion rates for each group using a two-sample t-test?

I'm leaning toward the second option because it weights each user equally. Also, the first option would involve many observations that are not independent.

$\endgroup$
3
  • $\begingroup$ Does this answer your question? A/B testing ratio of sums. While the context is slightly different, I believe the ultimate question asked is equivalent and the similarity in the answers (came up independently) reflects this. $\endgroup$
    – B.Liu
    Commented Jun 6, 2021 at 13:14
  • $\begingroup$ (1) What counts as a 'user'? Do I count as the same 'user' if I'm using my home computer, work computer, or laptop at a cafe or computer of friend or family member? What about several different people (related or not) sharing use of the same computer? // (2) What is the real metric? At the bottom line, do you care more about 'conversions' or number of items purchased or total dollars spent or total profit from those transactions? $\endgroup$
    – BruceET
    Commented Jun 6, 2021 at 16:40
  • 1
    $\begingroup$ @BruceET (1) Users log into an account, so they count as the same user on different devices. Different people using the same account count as the same user. (2) The "real metric" for this experiment is simply conversion rate as defined in the question. $\endgroup$
    – gasbag_1
    Commented Jun 7, 2021 at 3:05

1 Answer 1

2
$\begingroup$

Both of your proposed methods may introduce some sort of bias to the result as the randomisation unit (a user) is not the same as the analysis unit (a recommendation view). As you pointed out, there is a dependency between users and views as some users will view many recommendations and others will view none, which leads us to a case of cluster randomisation. This affects the variance estimate, which in turn affects your t-statistic and p-value.

The common mitigation strategy in online experimentation is to use the delta method (Section 3 in [1]) or some kind of bootstrap (Section 2 in [2]). Chapters 14 and 18 of Kohavi et al.'s book on trustworthy online controlled experiments [3] give an accessible introduction to these techniques.

Another way, which will change your hypothesis, is to bring the analysis unit to the same level as randomisation unit. An example is to compute conversion rate on the user level, i.e. the number of users who has chosen an item from their recommendation at least once divided by the total number of users in the group.

Of course, this proposal will be useless if you are interested in whether your users will choose more items from your recommendations rather than having more users choose from your recommendations.


[1] Deng, Knoblich, and Lu (2018) Applying the Delta Method in Metric Analytics: A Practical Guide with Novel Ideas. In: KDD'18. https://arxiv.org/pdf/1803.06336.pdf
[2] Bakshy and Eckles (2013) Uncertainty in Online Experiments with Dependent Data: An Evaluation of Bootstrap Methods. In: KDD'13. https://arxiv.org/pdf/1304.7406.pdf
[3] Kohavi, Tang and Xu (2020) Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing.

$\endgroup$
1
  • $\begingroup$ After posting the answer, I realise the answers to this question probably did a better job than what I have just done. $\endgroup$
    – B.Liu
    Commented Jun 6, 2021 at 13:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.