R has quantile and probability functions for the F distribution (similar to the normal). You need 2 degrees of freedom for the F function: numerator and denominator. In the following example, we have 3 df for the numerator and 12 for the denominator.

qf(.95, df1=3, df2=12) # quantile - critical value of F
## [1] 3.490295
qf(.99, df1=3, df2=12)
## [1] 5.952545
pf(15, df1=3, df2=12)  # probability for a result or obtained value
## [1] 0.9997689

The critical value of F with df=(3,12) at alpha = .05 is 3.49. If we got an obtained F of 15 with df=(3,12) the p value would be 1-.9997689 (a very small number).

Slideshow computation

See the PowerPoint slideshow to see the setup for these computations.

N1 <- 16
Df1 <- N1-1
S1 <- 5.8
N2 <- 16
Df2 <- N2-1
S2 <- 1.7
F.samp <- S1/S2
F.samp
## [1] 3.411765
qf(.95,df1=Df1, df2=Df2)
## [1] 2.403447
1-pf(F.samp, df1=Df1, df2=Df2)
## [1] 0.01158209

Exercise

Suppose we have 2 samples and we want to know whether they were drawn from populations where the variances are equal. Sample1: N=50, V=25; Sample 2: N=60, V=30. How can we test? What is the best conclusion for these data?

N1 <- 60
Df1 <- N1-1
S1 <- 30
N2 <- 50
Df2 <- N2-1
S2 <- 25
F.samp <- S1/S2
F.samp
## [1] 1.2
qf(.95,df1=Df1, df2=Df2)
## [1] 1.582745
1-pf(F.samp, df1=Df1, df2=Df2)
## [1] 0.2568281

For a test like this, you want to put the larger variance in the numerator. For most problems in psychology, the numerator and denominator are obvious, and besides, the computer places them for you if you run a program for ANOVA or regression.

In this problem, the variances are not significantly different. Although we cannot accept the null, we can proceed to act as if the variances are the same until we get more information.