What to Do with the Button
It's time to answer the main question! Note that we chose the Mann-Whitney criterion for this A/B test.
Use
scipy.stats.mannwhitneyu(control_group_data, test_group_data, alternative = 'greater')
.
Uppgift
Swipe to start coding
- Perform the statistical analysis with the
Mann-Whitney
criterion.
Lösning
# Importing the pandas
import pandas as pd
# Importing the statsmodels.api
import statsmodels.api as sm
# Importing the scipy
import scipy
# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/1e089012-bfcf-4d61-9ac9-bb649ece39f2/abtest_with_changes.csv')
# Control group
df_control = df.query('group == "control" ')
# Test group
df_test = df.query('group == "test" ')
# Perform statistical analysis with the statistical criterion
print(scipy.stats.mannwhitneyu(df_control.contact_views_number, df_test.contact_views_number, alternative = 'greater'))
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 8
# Importing the pandas
import pandas as pd
# Importing the statsmodels.api
import statsmodels.api as sm
# Importing the scipy
import scipy
# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/1e089012-bfcf-4d61-9ac9-bb649ece39f2/abtest_with_changes.csv')
# Control group
df_control = df.query('group == "control" ')
# Test group
df_test = df.query('group == "test" ')
# Perform statistical analysis with the statistical criterion
print(scipy.stats.___(___.___, df_test.___, alternative = 'greater'))