ALPHA must be a scalar between 0 and 1, exclusive.

11 次查看(过去 30 天)
Can anybody help me?
I had this exception in my code.
The error is indicated in this line:
saida_multcompare, tabela_multcompare, stats_multcompare] = multcompare(stats_ANOVA, [1 2],'display','off');
Thanks
  2 个评论
Image Analyst
Image Analyst 2016-12-10
What is the value of stats_ANOVA or how did you get it?
Star Strider
Star Strider 2016-12-10
There are two different multcompare functions, each with different argument lists and different outputs.
Which one are you using?
What version of MATLAB are you using?
Your code does not match the documentation for either function that I have in R2016b.

请先登录,再进行评论。

回答(1 个)

Brendan Hamm
Brendan Hamm 2016-12-11
Older versions of MATLAB did have a slightly different syntax for the multcompare function which was:
multcompare(stats,alpha,...)
This has been changed in later releases to:
multcompare(stats,'Alpha',alpha,...)
but the latter is backwards compatible ... that is the former statement works in any version of MATLAB.
That being said you are passing in a vector containing 2 values, 1 and 2. Now alpha represents the significance level used in the hypothesis test. We can only perform the test at a single significance level, so you cannot pass in a vector as you do. Furthermore, it makes no sense to perform a hypothesis test at a significance level of 0 or 1, so the allowed range of value is (0,1).
Maybe try a reasonable significance level:
[
saida_multcompare, tabela_multcompare, stats_multcompare] = multcompare(stats_ANOVA, 0.05,'display','off');
If this was not what you intended, you will have to explain what you were trying to do with that function call above? What does [1,2] represent?

类别

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