CommencerCommencer gratuitement

Sample size for proportions

Real datasets can be messy. As an Analytics Engineer working with data in the real world, you will encounter situations where the variance in the data is too high to be able to capture a meaningful difference in the metrics. This problem is more likely to happen with continuous metrics such as the average order value in the previous exercise. There are several ways to tackle this, but one of the workarounds is finding a metric that has lower variance but still aligns with the business goals.

Here you will look at calculating the sample size for a binary metric; signup rate which represents whether a user signed up for the service or not, as opposed to the paid price which may vary more between users. The homepage DataFrame and pandas, numpy libraries are already loaded for you, as well as proportion_effectsize from statsmodels.stats.proportion and power from statsmodels.stats.

Cet exercice fait partie du cours

A/B Testing in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Calculate the baseline signup rate for group A
p_A = ____
print('Group A mean signup rate:', ____)
Modifier et exécuter le code