t-स्टैटिस्टिक से p-value निकालना

R में Hypothesis Testing

Richie Cotton

Data Evangelist at DataCamp

t-वितरण

  • टेस्ट स्टैटिस्टिक t, t-वितरण का पालन करता है.
  • t-वितरण में एक पैरामीटर होता है जिसे degrees of freedom या df कहते हैं.
  • t-वितरण सामान्य वितरण जैसा दिखता है, पर उसकी टेल्स मोटी होती हैं.

स्टैंडर्ड नॉर्मल वितरण के PDF और 1 degree of freedom वाले t-वितरण की तुलना दर्शाने वाला ग्राफ. t-वितरण की टेल्स मोटी हैं और बीच का पीक छोटा है.

R में Hypothesis Testing

Degrees of freedom

  • जैसे-जैसे degrees of freedom बढ़ते हैं, t-वितरण नॉर्मल वितरण के करीब आता है.
  • नॉर्मल वितरण, infinite degrees of freedom वाला t-वितरण है.
  • Degrees of freedom, डेटा सैंपल में अधिकतम तार्किक रूप से स्वतंत्र मानों की संख्या है.

स्टैंडर्ड नॉर्मल वितरण के PDF और अलग-अलग degrees of freedom वाले t-वितरणों की तुलना दिखाने वाला ग्राफ. जैसे-जैसे degrees of freedom बढ़ते हैं, टेल्स पतली और पीक ऊँचा होता है, जो नॉर्मल वितरण जैसा लगता है.

R में Hypothesis Testing

Degrees of freedom निकालना

  • मान लीजिए आपके डेटासेट में 5 स्वतंत्र ऑब्जर्वेशन हैं.
  • चार मान 2, 6, 8, और 5 हैं.
  • आपको सैंपल का mean 5 भी पता है.
  • अब आखिरी मान स्वतंत्र नहीं रहा; उसे 4 होना ही होगा.
  • इसलिए 4 degrees of freedom हैं.
  • $df = n_{child} + n_{adult} - 2$
R में Hypothesis Testing

परिकल्पनाएँ

$H_{0}$: जिन लोगों ने पहले बच्चे के रूप में कोड किया और जिन्होंने पहले वयस्क के रूप में कोड किया, उनके लिए mean compensation (USD में) समान है.

$H_{A}$: जिन्होंने पहले बच्चे के रूप में कोड किया, उनके लिए mean compensation (USD में) उन लोगों की तुलना में ज्यादा है जिन्होंने पहले वयस्क के रूप में कोड किया.

 

Right-tailed test उपयोग करें.

R में Hypothesis Testing

Significance level

$\alpha = 0.1$

यदि $p \le \alpha$ हो तो $H_{0}$ को अस्वीकार करें.

R में Hypothesis Testing

p-value निकालना: एक proportion बनाम एक value

p_value <- pnorm(z_score, lower.tail = FALSE)
R में Hypothesis Testing

p-value निकालना: अलग-अलग समूहों के दो means

numerator <- xbar_child - xbar_adult
denominator <- sqrt(s_child ^ 2 / n_child + s_adult ^ 2 / n_adult)
t_stat <- numerator / denominator
2.4046
degrees_of_freedom <- n_child + n_adult - 2
2578
  • टेस्ट स्टैटिस्टिक का standard error एक approximation से निकाला गया है (bootstrapping नहीं).
  • Normal CDF नहीं, t-वितरण की CDF का उपयोग करें.
p_value <- pt(t_stat, df = degrees_of_freedom, lower.tail = FALSE)
0.008130
R में Hypothesis Testing

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

R में Hypothesis Testing

Preparing Video For Download...