p value of f test

62 views (last 30 days)
or dsad
or dsad on 2 Jun 2012
Commented: Edgar Pena on 8 Jun 2020
hello i have a problem,whan i preform [p,table2h,stats] = anova1(arr) because my Fst is so big the Pvalue is zero.Obviously he can not be zero when i debuge the code and go to the workspace window and i open the variable p it's value is also zero!(  I clicked twise on the cell containing the value zero but still value shown is zero)
moreover i make that xlswrite('axel.xlsx',p,'axel','G34:G34'); and whan i open the axel i saw zero
hwo can i recive the exactly value of Pvalue thank

Accepted Answer

or dsad
or dsad on 2 Jun 2012
my statis is F(6,145584)=272 i change the format to long and also to longENG(i recive 0.00000000000000e+000)
i asked to present the exactly value... there is more soluation?
  1 Comment
Wayne King
Wayne King on 2 Jun 2012
with that F distribution, a value of 14 is already less than 10^{-15} so I'm not sure how you can expect to have a nonzero solution with a value of 272.

Sign in to comment.

More Answers (2)

Tom Lane
Tom Lane on 2 Jun 2012
This does not produce the exact result you desire, but it may be instructive. Suppose we compute the p-value for different F values. This is the upper tail of the F distribution, so we subtract the cdf from 1. We can do this okay for F=2, but we get zero for F=20 because the cdf is too close to 1 and the difference is less than eps:
>> 1-fcdf(2,6,145584)
ans =
0.0620
>> 1-fcdf(20,6,145584)
ans =
0
We can instead compute the p-value as the lower tail of 1/F and swapping the degrees of freedom. That allows us to achieve values less than eps:
>> fcdf(1/2,145584,6)
ans =
0.0620
>> fcdf(1/20,145584,6)
ans =
1.6677e-23
So if we use this technique to investigate values closer to 272, we find that we can get a non-zero value for F=200 but not F=272:
>> fcdf(1/200,145584,6)
ans =
5.5078e-255
>> fcdf(1/272,145584,6)
ans =
0
Maybe the result is less than realmin which is approximately 2e-308. If I plot the function on a semi-log plot, it looks like the result is close to 1e-340:
semilogy(200:272,fcdf(1./(200:272),145584,6))
  2 Comments
Wayne King
Wayne King on 2 Jun 2012
Nice, Tom!
Edgar Pena
Edgar Pena on 8 Jun 2020
Very neat! It worked for me.

Sign in to comment.


Wayne King
Wayne King on 2 Jun 2012
If you use
>>format long
and display the p-value does it still say 0? What is your F value and what are the numerator and denominator degrees of freedom.
And more importantly is it really necessary to know the p-value exactly if it less than 10^{-8} or 10^{-9} just for sake of argument. Can't you just report something like p<10^{-9}?

Tags

Community Treasure Hunt

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

Start Hunting!