Fisher's Exact test

R में A/B Testing

Lauryn Burleigh

Data Scientist

Specifications

  • श्रेणीबद्ध डेटा का नॉन-पैरामीट्रिक
    • क्या Cheese या Pepperoni पिज़्ज़ा फिर खाया जाएगा
  • सैंपल < 1000
  • कम से कम 20% के लिए फ़्रीक्वेंसी < 5
  • सही p-value के लिए Fisher's Exact test उपयोग करें
  • 2x2 फ़्रीक्वेंसी टेबल

Hypergeometric Distribution

  • फ़्रीक्वेंसी टेबल की likelihood
table(Pizza$Topping, Pizza$EatAgain)
              No Yes
  Cheese     140 360
  Pepperoni   80 420
R में A/B Testing

Hypotheses

  • शून्य परिकल्पना: फिर से पिज़्ज़ा खाने और टॉपिंग समूह में कोई संबंध नहीं

विभिन्न लोगों के हाथों से उठाए जा रहे पिज़्ज़ा स्लाइस का फ़ोटो.

R में A/B Testing

Sample

library(pwr)
pwr.chisq.test(w = 0.1, df = 2, 
               power = 0.80, 
               sig.level = 0.05)
     Chi squared power calculation 
              w = 0.1
              N = 963.4689
             df = 2
      sig.level = 0.05
          power = 0.8
NOTE: N is the number of observations
table(Pizza$Topping, Pizza$EatAgain)
              No Yes
  Cheese     140 360
  Pepperoni   80 420
R में A/B Testing

Test

freqtbl <- table(Pizza$Topping, 
                 Pizza$Time)
fisher.test(freqtbl) 
    Fisher's Exact Test for Count Data
data:  freqtbl
p-value = 0.001809
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
 0.4569013 0.8417208
sample estimates:
odds ratio 
 0.6209987 
R में A/B Testing

Effect size

freqtbl <- table(Pizza$Topping, 
                 Pizza$Time)
fisher.test(freqtbl) 
  • Small: 1.5
  • Medium: 2.5
  • Large: 4
  • Pepperoni पिज़्ज़ा, Cheese पिज़्ज़ा से 0.62 गुना
Fisher's Exact Test for Count Data
data:  freqtbl
p-value = 0.001809
alternative hypothesis: true odds 
ratio is not equal to 1
95 percent confidence interval:
 0.4569013 0.8417208
sample estimates:
odds ratio 
 0.6209987  
R में A/B Testing

Power

library(pwr)
pwr.2p.test(h = 0.62, n = 500, 
            sig.level = 0.002) 
    Difference of proportion power 
 calculation for binomial distribution

              h = 0.62
              n = 500
      sig.level = 0.002
          power = 1
    alternative = two.sided

NOTE: same sample sizes
R में A/B Testing

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

R में A/B Testing

Preparing Video For Download...