Plotting the distribution
In this exercise, you will visualize the test and control conversion rates as distributions. It is helpful to practice what was covered in the example, as this may be something you have not applied before. Additionally, viewing the data in this way can give a sense of the variability inherent in our estimation.
Four variables, the test and control variances (test_var
, cont_var
), and the test and control conversion rates (test_conv
and cont_conv
) have been loaded for you.
Diese Übung ist Teil des Kurses
Customer Analytics and A/B Testing in Python
Anleitung zur Übung
- Using the calculated
control_sd
andtest_sd
create the range of x values to plot over. It should be 3 standard deviations in either direction from thecont_conv
andtest_conv
respectively. - Plot the Normal pdf of the test and control groups by specifying the conversion rate as the mean and the standard deviation in that order in
norm.pdf()
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Compute the standard deviations
control_sd = cont_var**0.5
test_sd = test_var**0.5
# Create the range of x values
control_line = np.linspace(cont_conv - 3 * control_sd, cont_conv + 3 * ____, 100)
test_line = np.linspace(test_conv - 3 * ____, test_conv + 3 * ____, 100)
# Plot the distribution
plt.plot(control_line, norm.pdf(control_line, ____, ____))
plt.plot(test_line, norm.pdf(test_line, ____, ____))
plt.show()