Any idea how to do and represent ttest results on box plot?

조회 수: 37 (최근 30일)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 2월 17일
답변: Matt J 2020년 2월 17일
I have boxplot that are 6 boxplots represented in on x and y axis. I wnt to do ttest to find the signigcance of the data between the plots.
My first question is that how can I do ttest for these 6 plots? should it be based on the pair of them like 1 and 2, 1 and 3 up to 1 and 6 and then 2 and 3 and so on which would be 15 pairs. Abny idea how to do that for 6 series of numbers (6 boxplots)?
My second question is how to represent the output on the boxplot to show the significance?
Thanks a lot
Update:
I found this online and I think I need to make similar plot.
The question is now how to add those horizontal lines above the boxplots with the pvalue? and as I have 6 boxplots, I am afraid representing in that way would make the plot nasty and hard to understand. Any idea?

답변 (2개)

Jakob B. Nielsen
Jakob B. Nielsen 2020년 2월 17일
Yes - the way forward is to compare 1 and 2, 1 and 3 and so on. You could look into some of the built-in tools in matlab, for example combining anova1 and multcompare, which is way easier than 'doing it by hand'. multcompare includes a graphical representation as well.

Matt J
Matt J 2020년 2월 17일
Usually, I just overlay them in powerpoint. But if you must automate this, one not too difficult way would be to use the line command to draw the lines, keeping their handles in a vector H. Then, put the p-values in the legend,
legend(H,"p = " + pvalues);

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by