To calculate the probability of an F distribution in MATLAB, you can use the fcdf
function. The fcdf
function calculates the cumulative distribution function (CDF) of the F distribution.
The syntax for fcdf
is:
main.m18 chars2 lines
where X
is the F statistic value, V1
is the degrees of freedom for the numerator, and V2
is the degrees of freedom for the denominator.
For example, suppose you have an F distribution with 3 degrees of freedom for the numerator and 20 degrees of freedom for the denominator, and you want to find the probability that the F statistic is less than or equal to 2.5. You can use the following code:
main.m44 chars5 lines
The output will be:
main.m11 chars2 lines
This means that the probability of getting an F statistic less than or equal to 2.5 with 3 and 20 degrees of freedom is 0.0821.
gistlibby LogSnag