p value of f test

조회 수: 22 (최근 30일)
or dsad
or dsad 2012년 6월 2일
댓글: Edgar Pena 2020년 6월 8일
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

채택된 답변

or dsad
or dsad 2012년 6월 2일
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
Wayne King
Wayne King 2012년 6월 2일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Tom Lane
Tom Lane 2012년 6월 2일
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
Wayne King
Wayne King 2012년 6월 2일
Nice, Tom!
Edgar Pena
Edgar Pena 2020년 6월 8일
Very neat! It worked for me.

댓글을 달려면 로그인하십시오.


Wayne King
Wayne King 2012년 6월 2일
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}?

태그

Community Treasure Hunt

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

Start Hunting!

Translated by