Get startedGet started for free

Difference in proportions A/B test

You are data scientist running an A/B test to explore the differences in signup (conversion) rates between two landing page variants 'C' and 'D' loaded in the homepage dataset. You are tasked with guiding the team using your A/B test results to make a decision regarding which landing page variant would result in a higher signup rate if rolled out to the website traffic.

homepage is available and has the columns signup and landing_page. Every row in the DataFrame corresponds to a unique user visiting the respective landing_page. The signup column consists of binary data: '1' means the user signed up and '0' means abandoned the page. pandas and numpy have been loaded for you.

This exercise is part of the course

A/B Testing in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

from statsmodels.stats.proportion import proportions_ztest, proportion_confint

# Calculate the number of users in groups C and D
n_C = homepage[homepage['____'] == '____']['____'].____()
n_D = homepage[homepage['____'] == '____']['____'].____()
print('Group C users:',n_C)
print('Group D users:',n_D)
Edit and Run Code