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

10 views (last 30 days)
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 Comments
Image Analyst
Image Analyst on 10 Dec 2016
What is the value of stats_ANOVA or how did you get it?
Star Strider
Star Strider on 10 Dec 2016
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.

Sign in to comment.

Answers (1)

Brendan Hamm
Brendan Hamm on 11 Dec 2016
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?

Community Treasure Hunt

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

Start Hunting!