Hi,
Which function should i use if I want to test whether two samples with different sizes have different means? I see many ttest functions in matlab

 채택된 답변

the cyclist
the cyclist 2011년 7월 10일

0 개 추천

>> ttest2(x,y)
where "x" and "y" are the vectors of your two samples.

댓글 수: 5

As per notes, x and y comes from independent random samples from normal distributions with equal means and equal but unknown variances. What about the case, once the variances are unequal?
Is this function also checking the variances before calculating the significance?
The documentation does state that the simplest syntax assumes equal variances. But if you read a bit further in the description, you will see that there is a calling syntax for unequal variances.
Specifically, see the VarType name-value pair
Jules
Jules 2024년 8월 27일
you responded nearly 9 years later. dedication.
Jules
Jules 2024년 8월 27일
if you see this, i am trying t do a t-test with two sets of unequal size. i do not care about the size difference, is there anyway to bypass this - other than doing it manually ?
Yes, still dedicated.
I'm unsure of what you mean, specifically I am not sure what you are trying to "bypass".
When you say "size", I assume you referring to the number of observations in each sample. ttest2 doesn't require equal-sized samples. (If you input two samples into ttest, it will do a pairwise test, and will require equal-sized samples.)
What specifically are you testing for, between the two samples? Whether or not they have different means? Or something else?
A careful reading of the documentation should answer your question.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

질문:

2011년 7월 9일

댓글:

2024년 8월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by