Software to Simplify Statistical Practice ...

F-Test for Equality of Two Variances - Example



The data for this case study were collected by Said Jahanmir of the NIST Ceramics Division in 1996 in connection with a NIST/industry ceramics consortium for strength optimization of ceramic strength.

The motivation for studying this data set is to illustrate the analysis of multiple factors from a designed experiment

This case study will utilize only a subset of a full study that was conducted by Lisa Gill and James Filliben of the NIST Statistical Engineering Division

The response variable is a measure of the strength of the ceramic material.

The goals of this case study is to determine if the nuisance factors (lab and batch) have an effect on the ceramic strength (y).





  1. Open the DataBook jahanmi2.vstz
    open this data file via the Help / Open Examples menu; it is in the Sample Data
  2. Choose the menu Analyze and the command F Test, under group Basic Statistics
  3. In Variables 1, select Y
  4. In Variables 2, select Batch
  5. Check the box Variable2 is a grouping variable
  6. Click OK





By default, R code is printed after parsing and before evaluation.
You can avoid this in File / Option / Advanced menu.

DataSheet is converted to DataFrame, in the form DataBook.DataSheet

> ## Summary Statistics:
> summary.vst(jahanmi2.Sheet1[,c('Y')], statistics = c('mean','semean','sd','nobs'), groups = jahanmi2.Sheet1$Batch)
Group nobs mean sd semean
1 240 688.9986 65.54909 4.231176
2 240 611.1560 61.85425 3.992675

> ## F-Test for Equality of Two Variances:
> .res <- var.test(formula = Y ~ Batch, data = jahanmi2.Sheet1, alternative = 'two.sided', ratio = 1, conf.level = 0.95)

> .res

F test to compare two variances

data: Y by Batch
F = 1.123, num df = 239, denom df = 239, p-value = 0.3704
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.8709874 1.4480271
sample estimates:
ratio of variances

> ## Find critical values for the F test:
> qf(0.025,.res$parameter[1],.res$parameter[2])
[1] 0.7755639

> qf(0.975,.res$parameter[1],.res$parameter[2])
[1] 1.289384 




The F test indicates that there is not enough evidence to reject the null hypothesis that the two batch variancess are equal at the 0.05 significance level.

(Reject the null hypothesis if F < 0.7756 or F > 1.2894)