The Third T-Test
Let's review the plots for the 'Purchase'
column of the control and test groups.
Levene's Test:
1234567891011121314151617181920# Import libraries import pandas as pd from scipy.stats import levene # Read .csv files df_control = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_control.csv', delimiter=';') df_test = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_test.csv', delimiter=';') # Do Levene's test statistic, p_value = levene(df_control['Purchase'], df_test['Purchase']) # Print result of Levene's test print('Statistic:', statistic) print('p-value:', p_value) # Determine whether the variances are similar if p_value > 0.05: print('The variances of the two groups are NOT statistically different') else: print('The variances of the two groups are statistically different')
Now perform a t-test for the 'Purchase'
columns:
H₀: The mean values of the column do not differ between the groups.
Hₐ: The mean values of the column differ between the groups.
123456789101112131415161718# Import libraries import pandas as pd from scipy.stats import ttest_ind # Read .csv files df_control = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_control.csv', delimiter=';') df_test = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_test.csv', delimiter=';') # Select only the 'Purchase' columns data_control = df_control['Purchase'] data_test = df_test['Purchase'] # Do T-Test statistic, p_value = ttest_ind(data_control, data_test, equal_var=True) # Print result of T-test print('Statistic:', statistic) print('p-value:', p_value)
In this case, the p-value (0.350
) is higher than the acceptable significance level (0.05
), indicating that there is insufficient evidence to suggest that the mean values differ between the groups. Now it's your turn!
Bedankt voor je feedback!
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Awesome!
Completion rate improved to 3.23
The Third T-Test
Veeg om het menu te tonen
Let's review the plots for the 'Purchase'
column of the control and test groups.
Levene's Test:
1234567891011121314151617181920# Import libraries import pandas as pd from scipy.stats import levene # Read .csv files df_control = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_control.csv', delimiter=';') df_test = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_test.csv', delimiter=';') # Do Levene's test statistic, p_value = levene(df_control['Purchase'], df_test['Purchase']) # Print result of Levene's test print('Statistic:', statistic) print('p-value:', p_value) # Determine whether the variances are similar if p_value > 0.05: print('The variances of the two groups are NOT statistically different') else: print('The variances of the two groups are statistically different')
Now perform a t-test for the 'Purchase'
columns:
H₀: The mean values of the column do not differ between the groups.
Hₐ: The mean values of the column differ between the groups.
123456789101112131415161718# Import libraries import pandas as pd from scipy.stats import ttest_ind # Read .csv files df_control = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_control.csv', delimiter=';') df_test = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c3b98ad3-420d-403f-908d-6ab8facc3e28/ab_test.csv', delimiter=';') # Select only the 'Purchase' columns data_control = df_control['Purchase'] data_test = df_test['Purchase'] # Do T-Test statistic, p_value = ttest_ind(data_control, data_test, equal_var=True) # Print result of T-test print('Statistic:', statistic) print('p-value:', p_value)
In this case, the p-value (0.350
) is higher than the acceptable significance level (0.05
), indicating that there is insufficient evidence to suggest that the mean values differ between the groups. Now it's your turn!
Bedankt voor je feedback!