Is ttest2 with the 'Vartype' set as 'unequal' essentially the same as a Welch's t-test?

32 ビュー (過去 30 日間)
Christoper Angelo Malayan
Christoper Angelo Malayan 2021 年 1 月 29 日
編集済み: Walter Roberson 2024 年 7 月 30 日
Hi all,
Just like to confirm that I've understand the documentation for using the ttest2 ( https://www.mathworks.com/help/stats/ttest2.html ) correctly.
Am I right to assume that when I set 'Vartype' as 'unequal' (essentially saying that variance of samples are NOT known to be the same), ttest2 becomes a Welch's t-test?
Hope you could help me confirm this.
Thank you

回答 (1 件)

Sim
Sim 2024 年 7 月 30 日
編集済み: Sim 2024 年 7 月 30 日
First Comment. As @DJB wrote in his/her comment, we can go to the "More About" Section of Two-sample t-test, and read the following:
In the case where it is not assumed that the two data samples are from populations with equal variances, the test statistic under the null hypothesis has an approximate Student's t distribution with a number of degrees of freedom given by Satterthwaite's approximation. This test is sometimes called Welch’s t-test.
Second Comment. If you open the algorithm from the Command Window
>> open ttest2
At Line 210 we can read (Please @MathWorks Support Team tell me if the following line is allowed to be shown!)
% unequal variances
...
dfe = (s2xbar + s2ybar) .^2 ./ (s2xbar.^2 ./ (nx-1) + s2ybar.^2 ./ (ny-1));
where "dfe" should be the "effective degrees of freedom" given by Satterthwaite's approximation, that we can read in the Welch's t-test article on Wikipedia:
Third Comment. The author of the Welch's t-test article on Wikipedia, recognises the MATLAB command
ttest2(data1, data2, 'Vartype', 'unequal')
to perform the Welch's t-test.

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by