t-test Mathematically
Swipe to show menu
The task of the t-test is to determine whether the difference between the two samples' means is significant. What should you take into consideration to perform it?
Obviously, you should consider the difference between the means itself.
As shown in the image below, the variance matters too.
Also, the size of each sample should be taken into consideration.
To account for the difference between the means, simply calculate that difference:
xห1โโxห0โThe situation becomes more complex when it comes to variance. The t-test assumes that the variance is equal for both samples. This will be explored further in the t-test assumptions chapter. To estimate the variance from two samples, the pooled variance formula is applied.
spooled2โ=df1โ+df2โs12โโ df1โ+s22โโ df2โโ=n1โ+n2โโ2s12โ(n1โโ1)+s22โ(n2โโ1)โWhere:
- n1โ - size of i-th sample;
- df1โ=niโโ1 - i-th degree of freedom;
- siโ2โ - i-th sample variance.
And to account for the size, it needs sample sizes:
n1โ,n2โโareย theย sampleย sizesPut it all together into t-statistic.
t=spooled2โโย โ ย n1โ1โ+n2โ1โโxห1โโxห0โโSample sizes may not always be used in the most intuitive manner. However, this approach ensures that t follows the t-distribution, which will be explored in the next chapter.
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat