Spearman-rank correlation

R में A/B Testing

Lauryn Burleigh

Data Scientist

Spearman correlation धारणाएँ

  • रैंक ऑर्डर - स्थिति के अनुसार क्रम
  • उच्च Spearman सहसंबंध - दोनों वैरिएबल में समान रैंक
  • सतत या डिस्क्रीट डेटा
    • ऑर्डिनल, इंटरवल, या रेशियो

चार बार जो ऊँचे से निचले क्रम में हैं, जहाँ सबसे ऊँचा 1 और सबसे नीचा 4 है.

R में A/B Testing

Monotonic संबंध

  • Spearman सहसंबंध (rho) - मोनोटोनिक संबंध

    • लगातार केवल बढ़ता या घटता नहीं
  • मोनोटोनिक, रैखिक से कम प्रतिबंधित

ggplot(data, aes(x = drownings, 
                 y = icecream)) +
  geom_point()

एक स्कैटर प्लॉट जो मोनोटोनिकली बढ़ता संबंध दिखाता है: x-अक्ष पर drownings बढ़ने पर y-अक्ष पर ice cream पहले स्थिर, फिर बढ़ता, फिर स्थिर.

एक स्कैटर प्लॉट जो मोनोटोनिकली घटता संबंध दिखाता है: x-अक्ष पर drownings बढ़ने पर y-अक्ष पर ice cream पहले स्थिर, फिर घटता, फिर स्थिर, फिर घटता.

R में A/B Testing

परिकल्पना और सैंपल साइज

  • शून्य परिकल्पना - समय और पिज़्ज़ा के आनंद में कोई मोनोटोनिक संबंध नहीं
library(pwr)
pwr.r.test(r = 0.3, power = 0.80, 
           sig.level = 0.05)
    approximate correlation power 
 calculation (arctangh transformation) 

              n = 84.07364
              r = 0.3
      sig.level = 0.05
          power = 0.8
    alternative = two.sided
R में A/B Testing

समूहों को नज़रअंदाज़ कर Spearman

cor.test(~ enjoyment + time, 
         data = pizza, 
         method = "spearman", 
        exact = FALSE)
    Spearman's rank correlation rho
data:  time and enjoyment
S = 2, p-value = .003245
alternative hypothesis: true rho is 
not equal to 0
sample estimates:
      rho 
0.9984962 
samp <- length(pizza$time)
[1]  90
R में A/B Testing

समूहों के भीतर Spearman

cor.test(~ enjoyment + time, 
         data = pizza, 
         subset = 
             (Topping == "Cheese"),
         method = "spearman",
         exact = FALSE)
    Spearman's rank correlation rho
data:  time and enjoyment
S = 1.2434e-14, p-value = 0.0003968
alternative hypothesis: true rho is 
not equal to 0
sample estimates:
rho 
  1 
ggplot(pizza, aes(x = enjoyment, 
                  y = time, 
                  color = Topping)) + 
  geom_point()

नीले रंग में Cheese डेटा का तीखा पॉज़िटिव स्लोप x-अक्ष के बाँए, और गुलाबी Pepperoni डेटा का कम तीखा पॉज़िटिव स्लोप दाएँ.

R में A/B Testing

Spearman पावर विश्लेषण

library(pwr)
pwr.r.test(r = 0.998, n = 90, 
           sig.level = 0.003)
     approximate correlation power 
  calculation (arctangh transformation) 

              n = 90
              r = 0.998
      sig.level = 0.003
          power = 1
    alternative = two.sided
R में A/B Testing

आउटपुट का संदर्भ लेना

rhotest <- cor.test(~ enjoyment + time, 
         data = pizza, 
         method = "spearman")
samp <- length(pizza$time)
library(pwr)
pwr.r.test(r = rhotest$estimate, 
           sig.level = rhotest$p.value,
           n = samp)
     approximate correlation power 
  calculation (arctangh transformation) 

              n = 90
              r = 0.998
      sig.level = 0.003
          power = 1
    alternative = two.sided
R में A/B Testing

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

R में A/B Testing

Preparing Video For Download...