प्रायोगिक डिज़ाइन: पावर विश्लेषण

Python में A/B Testing

Moe Lotfy, PhD

Principal Data Science Manager

प्रभाव आकार

  • औसतों के अंतर के लिए Cohen's d Cohen's d प्रभाव आकार का सूत्र
  • अनुपातों के अंतर के लिए Cohen's h

Cohen's h प्रभाव आकार का सूत्र

  • सामान्य नियम
    • छोटा प्रभाव = 0.2
    • मध्यम प्रभाव = 0.5
    • बड़ा प्रभाव = 0.8
# Calculate standardized effect size
from statsmodels.stats.proportion import proportion_effectsize
effect_size_std = proportion_effectsize(.33, .3)
print(effect_size_std)
0.0645
# Calculate standardized effect size
from statsmodels.stats.proportion import proportion_effectsize
effect_size_std = proportion_effectsize(p_B, p_A)
print(effect_size_std)
0.0716
Python में A/B Testing

अनुपातों के लिए सैंपल साइज़ अनुमान

# Import power module
from statsmodels.stats import power
# Calculate sample size
sample_size = power.TTestIndPower().solve_power(effect_size=effect_size_std,
                                                power=.80,
                                                alpha=.05,
                                                nobs1=None)
print(sample_size)
3057.547
Python में A/B Testing

सैंपल साइज़ और MDE का पावर पर प्रभाव

# Import t-test power package
from statsmodels.stats.power import TTestIndPower
# Specify parameters for power analysis
sample_sizes = array(range(10, 120))
effect_sizes = array([0.2, 0.5, 0.8])
# Plot power curves
TTestIndPower().plot_power(nobs=sample_sizes, effect_size=effect_sizes)
plt.show()

पावर कर्व: सैंपल साइज़, पावर और प्रभाव आकार का संबंध

Python में A/B Testing

औसतों के लिए सैंपल साइज़ अनुमान

# Calculate the baseline mean order value
mean_A = checkout[checkout['checkout_page']=='A']['order_value'].mean()
print(mean_A)
24.9564
std_A = checkout[checkout['checkout_page']=='A']['order_value'].std()
print(std_A)
2.418
# Specify the desired minimum average order value
mean_new = 26
# Calculate the standardized effect size
std_effect_size=(mean_new-mean_A)/std_A
Python में A/B Testing

औसतों के लिए सैंपल साइज़ अनुमान

sample_size = power.TTestIndPower().solve_power(effect_size=std_effect_size,
                                                power=.80,
                                                alpha=.05,
                                                nobs1=None)
print(sample_size)
85.306
Python में A/B Testing

अभ्यास करते हैं!

Python में A/B Testing

Preparing Video For Download...