Clear Filters
Clear Filters

How to use two -tail t-test?

25 views (last 30 days)
Weiyan Chen
Weiyan Chen on 23 Oct 2016
Commented: Star Strider on 23 Oct 2016
I have two set of data (x and y)and I want to show that x is bigger than y by using the two-tail t-test. I know that the if I want to check the tail I need to type 'Tail','right','left', or 'both'. But I do not understand how to show this.

Accepted Answer

Star Strider
Star Strider on 23 Oct 2016
If your hypothesis is ‘greater than’ or ‘less than’, use a one-tailed test. If your hypothesis is ‘different than’, use a two-tailed test.
The way to code it (for ttest2), is for example to test that the mean of ‘x’ is less than the mean of ‘y’:
[h,p,ci,stats] = ttest2(x, y, 'Tail','left');
Examine your data and consult the documentation to determine the correct option.
  2 Comments
Weiyan Chen
Weiyan Chen on 23 Oct 2016
If I want to show x is greater than y , I need to use 'right'?
Star Strider
Star Strider on 23 Oct 2016
Yes!
You are exactly correct in the context of the syntax I posted, with ‘x’ as the first argument and ‘y’ the second.

Sign in to comment.

More Answers (0)

Categories

Find more on Variables in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!