フィルターのクリア

multiple comparisons test figure object selection

4 ビュー (過去 30 日間)
Luck Haviland
Luck Haviland 2023 年 2 月 16 日
コメント済み: the cyclist 2023 年 2 月 19 日
I have a done a multiple comparisons test using the command multcompare. Say for example I have the following image:
load carsmall
[p,t,stats] = anova1(MPG,Origin);
[c,m,h,gnames] = multcompare(stats);
I want to be able to automatically select which group to highlight blue via code, as I am trying to automatically save my figure with exportfigure.
I suspect the command to highlight the group blue is something like
f=gcf
f.Children.SelectObject=2
I am pretty sure I have been able to do it before, but I can't for the life of me remember what command I used, or where I put the code I used before.
I would greatly appreciate any help on this.
Thank you,
Luck

回答 (1 件)

the cyclist
the cyclist 2023 年 2 月 16 日
The only way I could see to do this is to set the control type to "dunnett", and set the control group.
load carsmall
[p,t,stats] = anova1(MPG,Origin);
% Set the desired control group name, and the index will then be found programatically
controlGroup = "Japan";
controlIndex = find(stats.gnames==controlGroup);
[c,m,h,gnames] = multcompare(stats,"CriticalValueType","dunnett","ControlGroup",controlIndex);
I admit that I don't understand why this method relinquishes the ability to interact with the chart to change the control group, or why the error bars on the control group go away.
  2 件のコメント
Luck Haviland
Luck Haviland 2023 年 2 月 19 日
編集済み: Luck Haviland 2023 年 2 月 19 日
Thank you for your contribution, the cyclist. While this is interesting, I require the standard deviation bars to stay there for my final pictures, so I cannot accept this as an answer.
My apologies,
Luck
the cyclist
the cyclist 2023 年 2 月 19 日
Most of the multcompare code is written in MATLAB (as opposed to being buried in internal C code or whatever), so it is conceivable to me that you could dig into where this is happening, and make your own version. Be careful not to overwrite the original.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by