Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: First Levene's Test | Variances in A/B Testing
The Art of A/B Testing

book
Challenge: First Levene's Test

Aufgabe

Swipe to start coding

In this task, you need to read the files and perform a Levene's test on the 'Purchase' column. Is there a statistical difference between the variances?

  1. Import levene test.
  2. Do the Levene's test.

Lösung

# 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')

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 5
single

single

# Import libraries
import pandas as pd
from ___ import ___

# 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 = ___(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')

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt