Dataplot Vol 2 Vol 1

# RATIO OF STANDARD DEVIATIONS CONFIDENCE LIMITS RATIO OF VARIANCES CONFIDENCE LIMITS

Name:
RATIO OF STANDARD DEVIATIONS CONFIDENCE LIMITS
RATIO OF VARIANCES CONFIDENCE LIMITS
Type:
Analysis Command
Purpose:
Generates a confidence interval for the ratio of two standard deviations (or variances).
Description:
This is the confidence interval for the ratio of the standard deviations (or variances) for two unpaired samples. If the confidence interval for the ratio, this implies that the standard deviations (or variances) are equal.

The confidence interval or the ratio of the variances is:

$$\left( \frac{s_{1}^{2}/s_{2}^{2}} {F(\alpha2,\nu_{2}-1,\nu_{1}-1)}, (s_{1}^{2}/s_{2}^{2}) F(\alpha2,\nu_{2}-1,\nu_{1}-1) \right)$$

where $$s_{1}^{2}$$ and $$s_{2}^{2}$$ are the sample variances, $$n_1$$ and $$n_2$$ are the sample sizes and F is the percent point function of the F distribution. The confidence intervals are given for several values of alpha. This interval is not necessarily symmetric about the ratio $$\frac{s_{1}^{2}} {s_{2}^{2}}$$.

To obtain the confidence interval for the ratio of standard deviations, take the square root of the lower and upper confidence limits for the ratio of the variances.

This confidence interval assumes that both distributions have normal distributions. It is also known that this interval is 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.

Syntax 1:
RATIO OF STANDARD DEVIATIONS CONFIDENCE LIMITS <y1> <y2>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the first response variable;
<y2> is the second response variable;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
RATIO OF VARIANCES CONFIDENCE LIMITS <y1> <y2>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the first response variable;
<y2> is the second response variable;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
RATIO OF STANDARD DEVIATIONS CONFIDENCE LIMITS Y1 Y2
RATIO OF SD CONFIDENCE LIMITS Y1 Y2
RATIO OF VARIANCE CONFIDENCE LIMITS Y1 Y2
RATIO OF SD CONFIDENCE LIMITS Y1 Y2 SUBSET Y2 > 0
Note:
This ratio is known to be quite sensitive to departures from normality.

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

$$r_{i} = \frac{2 n_{i}} {\frac{\mu_{4}}{\sigma^{4}} - \frac{n_{i}-3}{n_{i}-1}}$$

where

$$\mu_{4} = \frac{\sum_{i=1}^{2}{\sum_{j=1}^{n_i} {(y_{ij} - \bar{y}_{i})^{4}}}} {n_{1} + n_{2}}$$

$$\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 interval:

$$\exp{\left( \ln{(c\frac{s_{1}^{2}}{s_{2}^{2}})} \pm \mbox{se} \Phi^{-1}(\alpha/2) \right) }$$

where

 $$\gamma_{4}$$ = $$(n_1 + n_2) \frac{ \sum_{i=1}^{2}{\sum_{j=1}^{n_i}{(y_{ij} - m_{i})^{4}}}} {(\sum_{i=1}^{2}{\sum_{j=1}^{n_i}{(y_{ij} - \mu_{i})^{2}}} )^{2}}$$ $$m_{i}$$ = sample trimmed mean of the i-th variable with trimming proportion $$\frac{1}{\sqrt{2 (n{i} - 4)}}$$ $$\bar{y_{i}}$$ = sample mean of the i-th variable se = $$\sqrt{ \frac{\gamma_{4} - k_{1}} {n_{1} - 1} + \frac{\gamma_{4} - k_{2}} {n_{2} - 1} }$$ $$k_1$$ = $$\frac{n_{1}-3}{n_{1}}$$ $$k_2$$ = $$\frac{n_{2}-3}{n_{2}}$$ c = $$\frac{\frac{n_{1}} {n_{1} - \Phi^{-1}(\alpha/2)}} {\frac{n_{2}} {n_{2} - \Phi^{-1}(\alpha/2)}}$$ $$\Phi^{-1}$$ = the percent point function of the normal distribution

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.

The above formula is for the variance. For the standard deviation, take the square root.

This interval is based on a standard normal distribution rather than an F 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

SET F TEST DEGREES OF FREEDOM SHOEMAKER

To specify Shoemaker's modification with integral degrees of freedom as suggested by Bonett, enter

SET F TEST DEGREES OF FREEDOM SHOEMAKER ROUNDED

To specify Bonett's method, enter

SET F TEST DEGREES OF FREEDOM BONETT
Note:
Shoemaker suggests that when more than two groups of data are available, it can improve accuracy to use all of the groups in the estimates of the pooled location (mu4) and pooled variance (sigma**2) instead of just the two groups being tested. That is,

$$\mu_{4} = \frac{\sum_{i=1}^{k}{\sum_{j=1}^{n_i} {(y_{ij} - \bar{y}_{i})^{4}}}} {n_{1} + n_{2} + ... + n_{k}}$$

$$\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 MU <value>
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 MU
SET SHOEMAKER F TEST POOLED VARIANCE 0
Note:
The following parameters are saved after the F test is performed.

 CUTLOW90 - lower 90% confidence limit CUTUPP90 - upper 90% confidence limit CUTLOW95 - lower 95% confidence limit CUTUPP95 - upper 95% confidence limit CUTLOW99 - lower 99% confidence limit CUTUPP99 - upper 99% confidence limit CUTLW999 - lower 99.5% confidence limit CUTUP999 - upper 99.5% confidence limit

Note:
In addition to the RATIO OF STANDARD DEVIATION CONFIDENCE LIMITS command, the following commands can also be used:

LET LCL = RATIO OF SD LOWER CONFIDENCE LIMTIS Y1 Y2
LET UCL = RATIO OF SD UPPER CONFIDENCE LIMTIS Y1 Y2
LET LCL = RATIO OF VARIANCE LOWER CONFIDENCE LIMTIS Y1 Y2
LET UCL = RATIO OF VARIANCE UPPER CONFIDENCE LIMTIS Y1 Y2

In addition to the above LET commands, built-in statistics are supported for 30+ different commands (enter HELP STATISTICS for details).

Note:
The F TEST can be used to generate the corresponding hypothesis test.
Default:
None
Synonyms:
SD is a synonym for STANDARD DEVIATION
CONFIDENCE INTERVAL is a synonym for CONFIDENCE LIMIT
Related Commands:
 F TEST = Perform a normal-based test that two standard deviations are equal. SIEGEL TUKEY TEST = Perform a ranks based test that two standard deviations are equal. BARTLETT TEST = Perform a k-sample Bartlett test for homogeneous variances. LEVENE TEST = Perform a k-sample Levene test for homogeneous variances. SQUARED RANKS TEST = Perform a k-sample squared ranks test for homogeneous variances. KLOTZ TEST = Perform a k-sample Klotz test for homogeneous variances. SD CONFIDENCE LIMITS = Compute the confidence limits for the standard deviation. CHI-SQUARE TEST = Performs a one sample chi-square test that the standard deviation is equal to a given value. T TEST = Performs a two-sample t test for equal means. CONFIDENCE LIMITS = Compute the confidence limits for the mean of a sample. STANDARD DEVIATION = Computes the standard deviation of a variable.
Reference:
F-based intervals for the ratio of two standard deviations are discussed in most introductory statistics books.

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.

Applications:
Confirmatory Data Analysis
Implementation Date:
2023/06
Program 1:


SKIP 25
READ AUTO83B.DAT Y1 Y2
DELETE Y2 SUBSET Y2 < 0
.
RATIO OF SD CONFIDENCE LIMITS Y1 Y2

The following output is generated

Confidence Limits for the Ratio of Standard Deviations

Numerator Variable:   Y1
Denominator Variable: Y2

Summary Statistics for Numerator Variable:
Number of Observations:                               249
Sample Mean:                                     20.14458
Sample Standard Deviation:                        6.41470

Summary Statistics for Variable 2:
Number of Observations:                                79
Sample Mean:                                     30.48101
Sample Standard Deviation:                        6.10771

Degrees of Freedom (Numerator):                       248
Degrees of Freedom (Denomerator):                      78
Ratio of Standard Deviations:                     1.05026

--------------------------------------------------
Confidence                  Lower          Upper
Value (%)   Ratio          Limit          Limit
--------------------------------------------------
50.000   1.050        0.99058        1.12161
80.000   1.050        0.93827        1.18830
90.000   1.050        0.90869        1.23086
95.000   1.050        0.88401        1.26950
99.000   1.050        0.83820        1.35006
99.900   1.050        0.78873        1.45285


Program 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 confidence intercal
.
set f test degrees of freedom default
print "Standard F interval"
ratio of sd confidence limits bottom mid
let lcl = ratio of sd lower confidence limit bottom mid
let ucl = ratio of sd upper confidence limit bottom mid
print lcl ucl

The following output is generated
Standard F interval

Confidence Limits for the Ratio of Standard Deviations

Numerator Variable:   BOTTOM
Denominator Variable: MID

Summary Statistics for Numerator Variable:
Number of Observations:                                10
Sample Mean:                                      6.02100
Sample Standard Deviation:                        1.58184

Summary Statistics for Variable 2:
Number of Observations:                                10
Sample Mean:                                      5.01900
Sample Standard Deviation:                        1.10440

Degrees of Freedom (Numerator):                         9
Degrees of Freedom (Denomerator):                       9
Ratio of Standard Deviations:                     1.43231

--------------------------------------------------
Confidence                  Lower          Upper
Value (%)   Ratio          Limit          Limit
--------------------------------------------------
50.000   1.432        1.13558        1.80659
80.000   1.432        0.91688        2.23750
90.000   1.432        0.80334        2.55373
95.000   1.432        0.71384        2.87392
99.000   1.432        0.56003        3.66322
99.900   1.432        0.41217        4.97734

THE COMPUTED VALUE OF THE CONSTANT LCL           =   0.7138401

THE COMPUTED VALUE OF THE CONSTANT UCL           =    2.873916

PARAMETERS AND CONSTANTS--

LCL     --        0.71384
UCL     --        2.87392

.
. Step 4:   Shoemaker F-test
.
set f test degrees of freedom shoemaker
print "Shoemaker degrees of freedom interval"
ratio of sd confidence limits bottom mid
print "Use pooled location and variance for Shoemaker"
set shoemaker f test pooled variance poolvar
set shoemaker f test pooled mu       mu4
ratio of sd confidence limits bottom mid
print "Shoemaker rounded degrees of freedom F Test"
set f test degrees of freedom shoemaker rounded
ratio of sd confidence limits bottom mid
set shoemaker f test pooled variance 0
set shoemaker f test pooled mu
The following output is generated

Shoemaker degrees of freedom interval

Confidence Limits for the Ratio of Standard Deviations
(Use Shoemaker Modifications to Degrees of Freedom)

Numerator Variable:   BOTTOM
Denominator Variable: MID

Summary Statistics for Numerator Variable:
Number of Observations:                                10
Sample Mean:                                      6.02100
Sample Standard Deviation:                        1.58184

Summary Statistics for Variable 2:
Number of Observations:                                10
Sample Mean:                                      5.01900
Sample Standard Deviation:                        1.10440

Degrees of Freedom (Numerator):                  12.42315
Degrees of Freedom (Denomerator):                12.42315
Ratio of Standard Deviations:                     1.43231

--------------------------------------------------
Confidence                  Lower          Upper
Value (%)   Ratio          Limit          Limit
--------------------------------------------------
50.000   1.432        1.17755        1.74220
80.000   1.432        0.98426        2.08433
90.000   1.432        0.88188        2.32631
95.000   1.432        0.80006        2.56420
99.000   1.432        0.65671        3.12394
99.900   1.432        0.51437        3.98837

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

Confidence Limits for the Ratio of Standard Deviations
(Use Shoemaker Modifications to Degrees of Freedom)

Numerator Variable:   BOTTOM
Denominator Variable: MID

Summary Statistics for Numerator Variable:
Number of Observations:                                10
Sample Mean:                                      6.02100
Sample Standard Deviation:                        1.58184

Summary Statistics for Variable 2:
Number of Observations:                                10
Sample Mean:                                      5.01900
Sample Standard Deviation:                        1.10440

Degrees of Freedom (Numerator):                   9.30474
Degrees of Freedom (Denomerator):                 9.30474
Ratio of Standard Deviations:                     1.43231

--------------------------------------------------
Confidence                  Lower          Upper
Value (%)   Ratio          Limit          Limit
--------------------------------------------------
50.000   1.432        1.14021        1.79924
80.000   1.432        0.92423        2.21969
90.000   1.432        0.81186        2.52695
95.000   1.432        0.72313        2.83698
99.000   1.432        0.57032        3.59714
99.900   1.432        0.42285        4.85169

Shoemaker rounded degrees of freedom F Test

THE FORTRAN COMMON CHARACTER VARIABLE F   TEST HAS JUST BEEN SET TO SHO2

Confidence Limits for the Ratio of Standard Deviations
(Shoemaker Modifications with Rounded Degrees of Freedom)

Numerator Variable:   BOTTOM
Denominator Variable: MID

Summary Statistics for Numerator Variable:
Number of Observations:                                10
Sample Mean:                                      6.02100
Sample Standard Deviation:                        1.58184

Summary Statistics for Variable 2:
Number of Observations:                                10
Sample Mean:                                      5.01900
Sample Standard Deviation:                        1.10440

Degrees of Freedom (Numerator):                        10
Degrees of Freedom (Denomerator):                       9
Ratio of Standard Deviations:                     1.43231

--------------------------------------------------
Confidence                  Lower          Upper
Value (%)   Ratio          Limit          Limit
--------------------------------------------------
50.000   1.432        1.31822        3.25440
80.000   1.432        0.87399        4.95711
90.000   1.432        0.67922        6.43618
95.000   1.432        0.54288        8.13193
99.000   1.432        0.34378       13.16491
99.900   1.432        0.19419       24.23791

THE FORTRAN COMMON SCALAR SHOEF    HAS JUST BEEN SET TO   0.0000000E+00

THE FORTRAN COMMON SCALAR SHOEF    HAS JUST BEEN SET TO  -0.1000000E+01

.
. Step 5:   Bonett
.
set f test degrees of freedom bonett
print "Bonett method"
ratio of sd confidence limits bottom mid
The following output is generated

Bonett method

Confidence Limits for the Ratio of Standard Deviations
(Bonett Method for Robustness)

Numerator Variable:   BOTTOM
Denominator Variable: MID

Summary Statistics for Numerator Variable:
Number of Observations:                                10
Sample Mean:                                      6.02100
Sample Standard Deviation:                        1.58184

Summary Statistics for Variable 2:
Number of Observations:                                10
Sample Mean:                                      5.01900
Sample Standard Deviation:                        1.10440

Ratio of Standard Deviations:                     1.43231

--------------------------------------------------
Confidence                  Lower          Upper
Value (%)   Ratio          Limit          Limit
--------------------------------------------------
50.000   1.432        1.28002        1.56990
80.000   1.432        1.12547        1.68414
90.000   1.432        1.02186        1.74895
95.000   1.432        0.92262        1.80328
99.000   1.432        0.68853        1.90498
99.900   1.432        0.19075        2.01659


Date created: 06/07/2023
Last updated: 06/07/2023

Please email comments on this WWW page to alan.heckert@nist.gov.