t-test Mathematically
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ˉ0The 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+df2s12⋅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;
- si2 - 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 ⋅ n11+n21xˉ1−xˉ0Sample 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
Can you explain what the t-distribution is and why it's important for the t-test?
What are the main assumptions of the t-test?
Could you provide an example of how to calculate the t-statistic with sample data?
Awesome!
Completion rate improved to 2.63
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ˉ0The 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+df2s12⋅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;
- si2 - 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 ⋅ n11+n21xˉ1−xˉ0Sample 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!