![]() |
F TESTName:
The two-sided hypothesis test is:
Note that for the upper tailed test, the larger of \( s_1 \) and \( s_2 \) is in the numerator and the smaller is in the denominator of the test statistic. The upper tailed hypothesis test is:
To specify the upper tailed test (the default), enter
To specify the two-tailed test, enter
The test conclusions are given for several values of alpha. Note that the F test is known to be quite senstive to departures from normality. There have been several proposals in the literature to make this test more robust. This is discussed further in the "Note:" section below.
where <y1> is the first response variable; <y2> is the second response variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
where <y1> ... <yk> is a list of two or more response variables; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax performs all the two-way F tests for the listed variables. This syntax supports the TO syntax.
F TEST Y1 Y2 Y3 F TEST Y1 TO Y10 F TEST Y1 Y2 SUBSET Y2 > 0
SET F TEST TYPE TWO SIDED
SET F TEST TYPE UPPER TAILED
Shoemaker (2003) proposed the following adjustment to the degrees of freedom to make the F test more robust against non-normality. The degrees of freedom are
where
\( \sigma^{2} = \frac{(n_{1} - 1) s_{1}^{2} + (n_{2} - 1) s_{2}^{2}} {n_{1} + n_{2}} \) with \( y_{ij} \), \( n_{i} \), \( s_{i} \) and \( \bar{y}_{i} \) denoting the data, the sample size, the standard deviation and the mean, respectively, of the i-th variable. This typically results in fractional degrees of freedom. The Dataplot FCDF, FPDF and FPPF routines were updated to support fractional degrees of freedom (fractional degrees of freedom less than 1 are set to 1). The justification and derivation of this modification is given in Shoemaker's paper. Simulations by Shoemaker indicated that the standard F test tends to be too conservative for light tailed distributions and too liberal for heavy tailed and skewed distributions. Using the Shoemaker modifications for degrees of freedom generally had good coverage properties with the exception of heavily skewed distributions with small samples where it was still too liberal. Bonett (2006) suggested that rounding the numerator degrees of freedom up to the nearest integer degrees of freedom and rounding the denominator degrees of freedom down to the nearest integer degrees of freedom (but not less than 1) prevented some anomalous behavior while reducing coverage performance only slightly. Bonett proposed the following statistic:
where
The parameter c is a small sample adjustment to help equalize the tail probabilities. It equals 1 when n1 and n2 equal and approaches 1 as n1 and n2 get large. For unequal sample sizes, the value of the test statistic will vary slightly depending on the value of alpha. The above formula is for the variance. For the standard deviation, take the square root. This test statistic is compared to a standard normal distribution. The justification and derivation of this test is given in the Bonett paper. Based on his simulations, he claims this method improves somewhat on the Shoemaker modification for heavy-tailed (particularly skewed) distributions. To specify Shoemaker's modification with fractional degrees of freedom, enter
To specify Shoemaker's modification with integral degrees of freedom as suggested by Bonett, enter
To specify Bonett's method, enter
\( \sigma^{2} = \frac{(n_{1} - 1) s_{1}^{2} + (n_{2} - 1) s_{2}^{2} + ... + (n_{k} - 1) s_{k}} {n_{1} + n_{2} + ... + n_{k}} \) To use these values, enter the commands
SET SHOEMAKER F TEST POOLED VARIANCE <value> To reset the default of Dataplot computing these from the two groups being tested, enter
SET SHOEMAKER F TEST POOLED VARIANCE 0
For an upper tailed test, the following parameters are saved
For a two sided test, the following are saved
If the Bonett method is specified, a two sided interval will always be used. Also, STATNU1, STATNU2 and POOLSD will not be saved.
LET STATCDF = F TEST CDF Y1 Y2 LET PVALUE = F TEST PVALUE Y1 Y2 In addition to the above LET commands, built-in statistics are supported for 30+ different commands (enter HELP STATISTICS for details).
Shoemaker (2003), "Fixing the F-Test for Equal Variances," The American Statistician, Vol. 57, pp. 105-114. Bonett (2006), "Robust Confidence Intervals for a Ratio of Standard Deviations," Applied Pyschological Measurement, Vol. 30, No. 5, pp. 432-439.
2023/06: Added support for Shoemaker and Bonett modifications 2023/06: Added support for two sided tests SKIP 25 READ AUTO83B.DAT Y1 Y2 DELETE Y2 SUBSET Y2 < 0 . F TEST Y1 Y2The following output is generatedTwo Sample F-Test for Equal Standard Deviations First Response Variable: Y1 Second Response Variable: Y2 H0: Sigma1/Sigma2 = 1 Ha: Sigma1/Sigma2 > 1 Sample One Summary Statistics: Number of Observations: 249 Sample Mean: 20.14458 Sample Standard Deviation: 6.41470 Sample Two Summary Statistics: Number of Observations: 79 Sample Mean: 30.48101 Sample Standard Deviation: 6.10771 Test: Standard Deviation (Numerator): 6.41470 Standard Deviation (Denomerator): 6.10771 Degrees of Freedom (Numerator): 248 Degrees of Freedom (Denomerator): 78 Pooled Standard Deviation: 6.34260 F-Test Statistic Value: 1.10305 F-Test CDF Value: 0.69032 F-Test P-Value: 0.30968 Conclusions (Upper 1-Tailed Test) H0: sigma1/sigma2 = 1; Ha: sigma1/sigma2 > 1 ------------------------------------------------------------ Null Significance Test Critical Hypothesis Level Statistic Region (>=) Conclusion ------------------------------------------------------------ 50.0% 1.10305 1.00590 REJECT 75.0% 1.10305 1.14047 ACCEPT 90.0% 1.10305 1.28015 ACCEPT 95.0% 1.10305 1.37347 ACCEPT 97.5% 1.10305 1.46106 ACCEPT 99.0% 1.10305 1.57145 ACCEPT 99.9% 1.10305 1.83565 ACCEPTProgram 2: . Step 1: Read the data . skip 25 read shoemake.dat bottom mid surface let y x = stack bottom mid surface let temp1 = cross tabulate mean y x let temp2 = (y - temp1)**4 let num = sum temp2 let den = size y let mu4 = num/den let y1var = variance bottom let y2var = variance mid let y3var = variance surface let n1 = size bottom let n2 = size mid let n3 = size surface let num = (n1 - 1)*y1var + (n2 -1)*y2var + (n3 - 1)*y3var let poolvar = num/den . . Step 2: Generate a box plot . character box plot line box plot xlimits 1 3 major xtic mark number 3 minor xtic mark number 0 xtic mark offset 0.5 0.5 x1tic mark label format alpha x1tic mark label content Bottom Middepth Surface tic mark label case asis set box plot fences on box plot y x . . Step 3: Default F-test . set f test degrees of freedom default print "Standard F Test" f test bottom mid let statval = f test bottom mid let statcdf = f test cdf bottom mid let pvalue = f test pvalue bottom mid print statval statcdf pvalueThe following output is generated Standard F Test Two Sample F-Test for Equal Standard Deviations First Response Variable: BOTTOM Second Response Variable: MID H0: Sigma1/Sigma2 = 1 Ha: Sigma1/Sigma2 > 1 Sample One Summary Statistics: Number of Observations: 10 Sample Mean: 6.02100 Sample Standard Deviation: 1.58184 Sample Two Summary Statistics: Number of Observations: 10 Sample Mean: 5.01900 Sample Standard Deviation: 1.10440 Test: Standard Deviation (Numerator): 1.58184 Standard Deviation (Denomerator): 1.10440 Degrees of Freedom (Numerator): 9 Degrees of Freedom (Denomerator): 9 Pooled Standard Deviation: 1.36417 F-Test Statistic Value: 2.05152 F-Test CDF Value: 0.85031 F-Test P-Value: 0.14969 Conclusions (Upper 1-Tailed Test) H0: sigma1/sigma2 = 1; Ha: sigma1/sigma2 > 1 ------------------------------------------------------------ Null Significance Test Critical Hypothesis Level Statistic Region (>=) Conclusion ------------------------------------------------------------ 50.0% 2.05152 1.00000 REJECT 75.0% 2.05152 1.59090 REJECT 90.0% 2.05152 2.44034 ACCEPT 95.0% 2.05152 3.17889 ACCEPT 97.5% 2.05152 4.02599 ACCEPT 99.0% 2.05152 5.35113 ACCEPT 99.9% 2.05152 10.10663 ACCEPT THE COMPUTED VALUE OF THE CONSTANT STATVAL = 2.051516 THE COMPUTED VALUE OF THE CONSTANT STATCDF = 0.8503082 THE COMPUTED VALUE OF THE CONSTANT PVALUE = 0.1496918 PARAMETERS AND CONSTANTS-- STATVAL -- 2.05152 STATCDF -- 0.85031 PVALUE -- 0.14969 . . Step 4: Shoemaker F-test . set f test degrees of freedom shoemaker print "Shoemaker degrees of freedom F Test" f test bottom mid print "Use pooled location and variance for Shoemaker" set shoemaker f test pooled variance poolvar set shoemaker f test pooled mu mu4 f test bottom mid print "Shoemaker rounded degrees of freedom F Test" set f test degrees of freedom shoemaker rounded f test bottom mid set shoemaker f test pooled variance 0 set shoemaker f test pooled muThe following output is generated Shoemaker degrees of freedom F Test Two Sample F-Test for Equal Standard Deviations (Use Shoemaker Modifications to Degrees of Freedom) First Response Variable: BOTTOM Second Response Variable: MID H0: Sigma1/Sigma2 = 1 Ha: Sigma1/Sigma2 > 1 Sample One Summary Statistics: Number of Observations: 10 Sample Mean: 6.02100 Sample Standard Deviation: 1.58184 Sample Two Summary Statistics: Number of Observations: 10 Sample Mean: 5.01900 Sample Standard Deviation: 1.10440 Test: Standard Deviation (Numerator): 1.58184 Standard Deviation (Denomerator): 1.10440 Degrees of Freedom (Numerator): 12.42315 Degrees of Freedom (Denomerator): 12.42315 Pooled Standard Deviation: 1.36417 F-Test Statistic Value: 2.05152 F-Test CDF Value: 0.89036 F-Test P-Value: 0.10964 Conclusions (Upper 1-Tailed Test) H0: sigma1/sigma2 = 1; Ha: sigma1/sigma2 > 1 ------------------------------------------------------------ Null Significance Test Critical Hypothesis Level Statistic Region (>=) Conclusion ------------------------------------------------------------ 50.0% 2.05152 1.00000 REJECT 75.0% 2.05152 1.47952 REJECT 90.0% 2.05152 2.11767 ACCEPT 95.0% 2.05152 2.63791 ACCEPT 97.5% 2.05152 3.20501 ACCEPT 99.0% 2.05152 4.04346 ACCEPT 99.9% 2.05152 6.73615 ACCEPT Use pooled location and variance for Shoemaker THE FORTRAN COMMON SCALAR SHOEF HAS JUST BEEN SET TO 0.1251562E+01 THE FORTRAN COMMON SCALAR SHOEF HAS JUST BEEN SET TO 0.4585221E+01 Two Sample F-Test for Equal Standard Deviations (Use Shoemaker Modifications to Degrees of Freedom) First Response Variable: BOTTOM Second Response Variable: MID H0: Sigma1/Sigma2 = 1 Ha: Sigma1/Sigma2 > 1 Sample One Summary Statistics: Number of Observations: 10 Sample Mean: 6.02100 Sample Standard Deviation: 1.58184 Sample Two Summary Statistics: Number of Observations: 10 Sample Mean: 5.01900 Sample Standard Deviation: 1.10440 Test: Standard Deviation (Numerator): 1.58184 Standard Deviation (Denomerator): 1.10440 Degrees of Freedom (Numerator): 9.30474 Degrees of Freedom (Denomerator): 9.30474 Pooled Standard Deviation: 1.36417 F-Test Statistic Value: 2.05152 F-Test CDF Value: 0.85454 F-Test P-Value: 0.14546 Conclusions (Upper 1-Tailed Test) H0: sigma1/sigma2 = 1; Ha: sigma1/sigma2 > 1 ------------------------------------------------------------ Null Significance Test Critical Hypothesis Level Statistic Region (>=) Conclusion ------------------------------------------------------------ 50.0% 2.05152 1.00000 REJECT 75.0% 2.05152 1.57799 REJECT 90.0% 2.05152 2.40166 ACCEPT 95.0% 2.05152 3.11256 ACCEPT 97.5% 2.05152 3.92318 ACCEPT 99.0% 2.05152 5.18299 ACCEPT 99.9% 2.05152 9.64550 ACCEPT Shoemaker rounded degrees of freedom F Test THE FORTRAN COMMON CHARACTER VARIABLE F TEST HAS JUST BEEN SET TO SHO2 Two Sample F-Test for Equal Standard Deviations (Shoemaker Modifications with Rounded Degrees of Freedom) First Response Variable: BOTTOM Second Response Variable: MID H0: Sigma1/Sigma2 = 1 Ha: Sigma1/Sigma2 > 1 Sample One Summary Statistics: Number of Observations: 10 Sample Mean: 6.02100 Sample Standard Deviation: 1.58184 Sample Two Summary Statistics: Number of Observations: 10 Sample Mean: 5.01900 Sample Standard Deviation: 1.10440 Test: Standard Deviation (Numerator): 1.58184 Standard Deviation (Denomerator): 1.10440 Degrees of Freedom (Numerator): 10 Degrees of Freedom (Denomerator): 9 Pooled Standard Deviation: 1.37649 F-Test Statistic Value: 2.05152 F-Test CDF Value: 0.85275 F-Test P-Value: 0.14725 Conclusions (Upper 1-Tailed Test) H0: sigma1/sigma2 = 1; Ha: sigma1/sigma2 > 1 ------------------------------------------------------------ Null Significance Test Critical Hypothesis Level Statistic Region (>=) Conclusion ------------------------------------------------------------ 50.0% 2.05152 1.00774 REJECT 75.0% 2.05152 1.58634 REJECT 90.0% 2.05152 2.41632 ACCEPT 95.0% 2.05152 3.13728 ACCEPT 97.5% 2.05152 3.96387 ACCEPT 99.0% 2.05152 5.25654 ACCEPT 99.9% 2.05152 9.89430 ACCEPT . . Step 5: Bonett . set f test degrees of freedom bonett print "Bonett method" f test bottom midThe following output is generated Bonett method Two Sample F-Test for Equal Standard Deviations (Bonett Method for Robustness) First Response Variable: BOTTOM Second Response Variable: MID H0: Sigma1/Sigma2 = 1 Ha: Sigma1/Sigma2 > 1 Sample One Summary Statistics: Number of Observations: 10 Sample Mean: 6.02100 Sample Standard Deviation: 1.58184 Sample Two Summary Statistics: Number of Observations: 10 Sample Mean: 5.01900 Sample Standard Deviation: 1.10440 Test: Standard Deviation (Numerator): 1.58184 Standard Deviation (Denomerator): 1.10440 Test Statistic Value (alpha = 0.05): 3.23288 Test CDF Value (alpha = 0.05): 0.99939 Test P-Value (alpha = 0.05): 0.00123 Conclusions H0: sigma1/sigma2 = 1; Ha: sigma1/sigma2 <> 1 --------------------------------------------------------------------------- Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Region (<=) Region (>=) Conclusion --------------------------------------------------------------------------- 50.0% 3.23288 -0.67449 0.67449 REJECT 80.0% 3.23288 -1.28155 1.28155 REJECT 90.0% 3.23288 -1.64485 1.64485 REJECT 95.0% 3.23288 -1.95996 1.95996 REJECT 99.0% 3.23288 -2.57583 2.57583 REJECT 99.9% 3.23288 -3.29053 3.29053 ACCEPT
Date created: 06/07/2023 |
Last updated: 06/07/2023 Please email comments on this WWW page to alan.heckert@nist.gov. |