Two Sample T-test for Comparing Two Means  

만약 X라는 모집단과 Y라는 모집단이 있을때, 두 모집단의 평균을 비교할때 사용됩니다. 

조건은, 두 모집단에서 각각 얻은 표본이 iid (identically independently distributed)로 정규분포를 따를것! 그리고 두 표본은 서로 독립적일것!! 이렇게 크게 두가지 조건이 있습니다.

참고로, 두 표본이 독립적이지 않을때 Paired t-test를 사용합니다. 예를들어 약 복용 전과 후 표본이라면 독립적이지 않겠죠. 그래서 Paired t-test의 대표적인건 보통 한 모집단에서 before / after를 비교할때 주로 사용됩니다.

> Hypothesis

$H_{o}=\bar{X}-\bar{Y}=D_{0}=0$  두 모집단의 평균 차이가 없다.

 

> Test statistics

- $t_{obs}= \frac{(\bar{X}-\bar{Y})-D_{0}}{se(\bar{X}-\bar{Y})}$

문제는, 두 모집단의 평균값 차이의 표준오차를 해야한다는건데요~ 두 모집단의 분산이 같다고 가정할때 pooled t-test를 사용하고, 두 모집단의 분산이 같지 않다고 가정할때 Satterthwaite Approximation을 사용합니다. 

 

(1) Pooled t-test

> Pooled t-test variance estimate : $S_{p}^2= \frac{ (n_{x}-1)S_{x}^2 + (n_{y}-1)S_{y}^2 }{ n_{x}+n_{y}-2}$

> Test statistics

- $t_{obs}= \frac{(\bar{X}-\bar{Y})-D_{0}}{\sqrt{S_{p}^2( \frac{1}{n_{x}} +\frac{1}{n_{y}})}} \sim t_{n_{x}+n_{y}-2}$, Under the null hypothesis.

 

(2) Two Sampe T-test using Satterthwaite Approximation  

> Test statistics

- $t_{obs}= \frac{(\bar{X}-\bar{Y})-D_{0}}{ \sqrt{ \frac{S_{x}^2}{n_{x}}+ \frac{S_{y}^2}{n_{y}}}} \sim t_{\gamma}$, Under the null hypothesis, where  $\gamma = \frac{ (\frac{S_{x}^2}{n_{x}} + \frac{S_{y}^2}{n_{y}})^2}{\frac{(\frac{S_{x}^2}{n_{x}})^2}{n_{x}-1} + \frac{ (\frac{S_{y}^2}{n_{y}})^2}{n_{y}-1} }$ d/f.

 

이때, 자유도는 Satterthwaite approximation으로 구하게 되고요~

소숫점으로 나오게 되면 내림으로 구하면 됩니다.

 

Test statistics값을 구해서, significant level에 따른 critical value(임계치)보다 높은 값이 나오면 가설을 reject하게 됩니다. 만약 P-value로 결론을 내릴땐, P-value가 significant level (예를들어 95%라고 한다면) 값보다 작은경우, 0.05보다 작을때 가설을 reject하게 됩니다. 즉, 가설이 두 모집단간의 평균 차이가 없다라고 했으니, 결론은 두 모집단간의 평균값이 차이있다!!가 되겠네요.

 

 

반응형

+ Recent posts