SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

RATIO OF MEANS CONFIDENCE INTERVAL

Name:
    RATIO OF MEANS CONFIDENCE INTERVAL
Type:
    Analysis Command
Purpose:
    Generates a confidence interval for the ratio of two means for paired samples.
Description:
    There are cases where a measurement is actually the ratio of two different measurements. That is,

      \[ R_i = \frac{Y_i} {X_i} \]

    It is often desired to generate the confidence interval for this ratio. Note that computing a standard confidence interval for R does not generate satisfactory results. This is due to the fact that, assuming Y and X are independent,

      \[ \begin{array}{lcl} E[\hat{R}] & = & E[\frac{\hat{Y}}{\hat{X}}] \\ & = & E[\hat{Y}] E[1/\hat{X}] \end{array} \]

    However, \( E[1/\hat{X}] \) is not equal to \( 1/E[\hat{X}] \).

    There have been a number of approaches to this problem. This command supports three different methods.

    Fieller derived confidence intervals for the case where Y and X are distributed as bivariate normal. Define the quantities

      \( \bar{X} \) = mean of X
      \( \bar{Y} \) = mean of Y
      \( \hat{\sigma}_{\bar{X}}^{2} \) = variance of \( \bar{X} \)
        = \( \frac{1}{N(N-1)} \sum_{i=1}^{N}{(X_{i} - \bar{X})^2} \)
      \( \hat{\sigma}_{\bar{Y}}^{2} \) = variance of \( \bar{Y} \)
        = \( \frac{1}{N(N-1)} \sum_{i=1}^{N}{(Y_{i} - \bar{Y})^2} \)
      \( \hat{\sigma}_{\bar{X},\bar{Y}} \) = \( \frac{1}{N(N-1)} \sum_{i=1}^{N} {(X_i - \bar{X})(Y_i - \bar{Y})} \)
      tq = t percent point value with N - 1 degrees of freedom

    The test statistic is

      \[ \hat{R} = \frac{\bar{Y}} {\hat{X}} \]

    For Fieller's confidence limits, we first compute

      \[ \frac{\bar{X}^2} {\hat{\sigma}_{\bar{X}}^2} \]

    If this quantity is less than or equal to \( t_{q}^2 \) then an unbounded interval results and Dataplot will not generate the confidence interval. Basically, this results if the confidence interval for X contains zero.

    If this quantity is less than or equal to \( t_{q}^2 \) then the following confidence interval is obtained

      \( \mbox{Lower Limit} = \frac{(\bar{X} \bar{Y} - t_{q}^{2} \hat{\sigma}_{\bar{X} \bar{Y}}) - \sqrt{ (\bar{X} \bar{Y} - t_{q}^{2} \hat{\sigma}_{\bar{X} \bar{Y}})^2 - (\bar{X}^2 - t_{q}^{2} \hat{\sigma}_{\bar{X}}^{2}) (\bar{Y}^2 - t_{q}^{2} \hat{\sigma}_{\bar{Y}}^{2})}} {\bar{X}^2 - t_{q}^{2} \hat{\sigma}_{\bar{X}}^{2}} \)

      \( \mbox{Upper Limit} = \frac{(\bar{X} \bar{Y} - t_{q}^{2} \hat{\sigma}_{\bar{X} \bar{Y}}) + \sqrt{ (\bar{X} \bar{Y} - t_{q}^{2} \hat{\sigma}_{\bar{X} \bar{Y}})^2 - (\bar{X}^2 - t_{q}^{2} \hat{\sigma}_{\bar{X}}^{2}) (\bar{Y}^2 - t_{q}^{2} \hat{\sigma}_{\bar{Y}}^{2})}} {\bar{X}^2 - t_{q}^{2} \hat{\sigma}_{\bar{X}}^{2}} \)

    The large sample approximation method (this is called the Taylor or delta method in the Franz paper) generates the following confidence interval

      \( \mbox{Lower Limit} = \hat{R} - t_{(\alpha/2,n-1)} \hat{R} \sqrt{C_{\bar{Y}\bar{Y}} + C_{\bar{X}\bar{X}} - 2 C_{\bar{Y}\bar{X}}} \)

      \( \mbox{Upper Limit} = \hat{R} + t_{(\alpha/2,n-1)} \hat{R} \sqrt{C_{\bar{Y}\bar{Y}} + C_{\bar{X}\bar{X}} - 2 C_{\bar{Y}\bar{X}}} \)

    where

      \( C_{\bar{Y},\bar{Y}} \) = \( \frac{s_{Y}^{2}} {N \bar{Y}^2} \)
      \( C_{\bar{X},\bar{X}} \) = \( \frac{s_{X}^{2}} {N \bar{X}^2} \)
      \( C_{\bar{Y},\bar{X}} \) = \( \frac{s_{X Y}} {N \bar{X} \bar{Y}} \)
    with \( s_{Y} \), \( s_{X} \), and \( s_{X Y} \) denoting the standard deviation of Y, the standard deviation of X, and the covariance between X and Y, respectively.

    The log ratio method generates the following confidence interval

      \( \mbox{Lower Limit} = \hat{R} \exp{(-t_{(\alpha/2,n-1)} \sqrt{C_{\bar{Y} \bar{Y}} + C_{\bar{X} \bar{X}} - 2 C_{\bar{Y} \bar{X}}})} \)

      \( \mbox{Upper Limit} = \hat{R} \exp{(t_{(\alpha/2,n-1)} \sqrt{C_{\bar{Y} \bar{Y}} + C_{\bar{X} \bar{X}} - 2 C_{\bar{Y} \bar{X}}})} \)

    The large sample approximation and the log ratio method do not generate unbounded intervals. Also, the log ratio method can generate asymmetric intervals.

    Note that there is some disagreement in the literature about the appropriateness of these methods. For example, Franz argues that the unbounded intervals are a result of the denominator being close to zero with the consequence that the ratio can assume arbitrarily large values. Therefore any method that does not allow for unbounded intervals is not valid. On the other hand, Sherman argues that the unbounded Fieler intervals are simply nonsensical and advocates the use of the large sample approximation and log ratio methods.

    To specify the method to use, enter the command

      SET RATIO OF MEANS METHOD <FIELER/LOG RATIO/LARGE SAMPLE>
Syntax:
    RATIO OF MEANS CONFIDENCE INTERVAL <y1> <y2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first (numerator) response variable;
                <y2> is the second (denominator) response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    The variables <y1> and <y2> must be of the same length and are assumed to be paired.

Examples:
    RATIO OF MEANS CONFIDENCE INTERVAL Y X
    RATIO OF MEANS CONFIDENCE INTERVAL Y X SUBSET TAG > 2
    RATIO OF MEANS CONFIDENCE INTERVAL Y1 Y2 SUBSET Y1 > 0
Note:
    A table of confidence intervals is printed for alpha levels of 50.0, 75.0, 90.0, 95.0, 99.0, 99.9, 99.99, and 99.999. The sample sizes, sample means, sample standard deviations, and the standard error are also printed. The t-value and t-value X standard error are printed in the table.
Note:
    The RATIO OF MEANS CONFIDENCE LIMIT command automatically saves the following parameters:

      CUTLOW90 = the lower 90% confidence limit
      CUTUPP90 = the upper 90% confidence limit
      CUTLOW95 = the lower 95% confidence limit
      CUTUPP95 = the upper 95% confidence limit
      CUTLOW99 = the lower 99% confidence limit
      CUTUPP99 = the upper 99% confidence limit
      CTLOW999 = the lower 99.9% confidence limit
      CTUPP999 = the upper 99.9% confidence limit
Note:
    In addition to the RATIO OF MEANS CONFIDENCE LIMIT command, the following commands can also be used:

      LET A = RATIO OF MEANS Y X

      LET ALPHA = <value>
      LET A = RATIO OF MEANS LOWER CONFIDENCE LIMIT Y X
      LET A = RATIO OF MEANS UPPER CONFIDENCE LIMIT Y X

    These statistics can be used in a number of commands. For details, enter

Default:
    The default method is Fieler's method.
Synonyms:
    None
Related Commands: Reference:
    V. H. Franz ((2007), "Ratios: A Short Guide to Confidence Limits and Proper Use," arXiv:0710.2024 [stat.AP].

    E. C. Fieler (1940), "The Biological Standardization of Insulin," Supplement to the Journal of the Royal Statistical Society, Vol. 7, No. 1, pp. 1-64.

    E. C. Fieler (1940), "A Fundamental Formula in the Statistics of Biological Assays and Some Applications", Quarterly Journal of Pharmacy and Pharmacology, Vol. 17, pp. 117-123.

    E. C. Fieler (1940), "Some Problems in Interval Estimation," Journal of the Royal Statistical Society (B), Vol. 16, No. 2, pp. 175-185.

    Sherman, Maity, and Wang (2011), "Inferences for the Ratio: Fieller's Interval, Log Ratio, and Large Sample Based Confidence Intervals", AStA Adv Stat Anal 95:313–323.

    Cochran (1977), "Sampling Techniques," Wiley, New York.

    Lohr (2009), "Sampling: Design and Analysis," Second Edition, Brooks/Cole, Pacific Grove.

Applications:
    Confirmatory Data Analysis
Implementation Date:
    2019/09
Program 1:
     
    . Step 1:   Define data (taken from Sherman article, original source
    .
    .           Lehtonen and Pahkinen (2004), "Practical Methods for
    .           Design and Analysis of Complex Surveys," 2nd Edition,
    .           New York: Wiley.
    .
    read y x
     4123   26881
      760    4896
      721    3730
      142     556
      187    1463
      331    1946
      127     834
      219     932
    end of data
    .
    . Step 2:   Large sample interval
    .
    let alpha = 0.95
    set write decimals 4
    set ratio of means method large sample
    let r1   = ratio of means y x
    let r1ll = ratio of means lower confidence limit y x
    let r1ul = ratio of means upper confidence limit y x
    .
    ratio of means confidence limit y x
    pause
        
    The following output is generated
     PARAMETERS AND CONSTANTS--
    
        R1      --         0.1603
        R1LL    --         0.1452
        R1UL    --         0.1754
     
                Confidence Limits for the Ratio of Means
                  (Large Sample Approximation Method)
     
    Numerator Variable:   Y
    Denominator Variable: X
     
     
    Summary Statistics for Numerator Variable:
    Number of Observations:                                 8
    Sample Mean:                                     826.2500
    Sample Standard Deviation:                      1355.6149
    Sample Coefficient of Variation:                   1.6407
     
    Summary Statistics for Variable 2:
    Number of Observations:                                 8
    Sample Mean:                                    5154.7500
    Sample Standard Deviation:                      8909.8733
    Sample Coefficient of Variation:                   1.7285
     
    Correlation:                                       0.9991
     
     
     
    ---------------------------------------------------------
      Confidence                         Lower          Upper
       Value (%)          Ratio          Limit          Limit
    ---------------------------------------------------------
          50.000         0.1603         0.1558         0.1648
          75.000         0.1603         0.1523         0.1683
          90.000         0.1603         0.1482         0.1724
          95.000         0.1603         0.1452         0.1754
          99.000         0.1603         0.1380         0.1826
          99.900         0.1603         0.1258         0.1948
          99.990         0.1603         0.1102         0.2104
          99.999         0.1603         0.0895         0.2311
        
    . set ratio of means method log ratio let r2 = ratio of means y x let r2ll = ratio of means lower confidence limit y x let r2ul = ratio of means upper confidence limit y x . ratio of means confidence limit y x pause The following output is generated
     PARAMETERS AND CONSTANTS--
    
        R2      --         0.1603
        R2LL    --         0.1459
        R2UL    --         0.1761
     
                Confidence Limits for the Ratio of Means
                           (Log Ratio Method)
     
    Numerator Variable:   Y
    Denominator Variable: X
     
     
    Summary Statistics for Numerator Variable:
    Number of Observations:                                 8
    Sample Mean:                                     826.2500
    Sample Standard Deviation:                      1355.6149
    Sample Coefficient of Variation:                   1.6407
     
    Summary Statistics for Variable 2:
    Number of Observations:                                 8
    Sample Mean:                                    5154.7500
    Sample Standard Deviation:                      8909.8733
    Sample Coefficient of Variation:                   1.7285
     
    Correlation:                                       0.9991
     
     
     
    ---------------------------------------------------------
      Confidence                         Lower          Upper
       Value (%)          Ratio          Limit          Limit
    ---------------------------------------------------------
          50.000         0.1603         0.1558         0.1649
          75.000         0.1603         0.1525         0.1685
          90.000         0.1603         0.1486         0.1728
          95.000         0.1603         0.1459         0.1761
          99.000         0.1603         0.1394         0.1842
          99.900         0.1603         0.1293         0.1987
          99.990         0.1603         0.1173         0.2191
          99.999         0.1603         0.1031         0.2493
        
    . set ratio of means method fieler let r3 = ratio of means y x let r3ll = ratio of means lower confidence limit y x let r3ul = ratio of means upper confidence limit y x . ratio of means confidence limit y x The following output is generated
     PARAMETERS AND CONSTANTS--
    
        R3      --         0.1603
        R3LL    --***************
        R3UL    --***************
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   90.00000    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   95.00000    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   99.00000    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   99.90000    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   99.99000    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   99.99900    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
                Confidence Limits for the Ratio of Means
                            (Fieller Method)
     
    Numerator Variable:   Y
    Denominator Variable: X
     
     
    Summary Statistics for Numerator Variable:
    Number of Observations:                                 8
    Sample Mean:                                     826.2500
    Sample Standard Deviation:                      1355.6149
    Sample Coefficient of Variation:                   1.6407
     
    Summary Statistics for Variable 2:
    Number of Observations:                                 8
    Sample Mean:                                    5154.7500
    Sample Standard Deviation:                      8909.8733
    Sample Coefficient of Variation:                   1.7285
     
    Correlation:                                       0.9991
     
     
     
    ---------------------------------------------------------
      Confidence                         Lower          Upper
       Value (%)          Ratio          Limit          Limit
    ---------------------------------------------------------
          50.000         0.1603         0.1568         0.1676
          75.000         0.1603         0.1549         0.1892
          90.000         0.1603             **             **
          95.000         0.1603             **             **
          99.000         0.1603             **             **
          99.900         0.1603             **             **
          99.990         0.1603             **             **
          99.999         0.1603             **             **
        
Program 2:
     
    . Step 1:   Define data
    .
    read y x
      0.1268825E+10  0.1246669E+10
      0.1295448E+10  0.1246669E+10
      0.1295448E+10  0.1268825E+10
      0.1168487E+08  0.1014325E+08
      0.1141398E+08  0.1014325E+08
      0.1168487E+08  0.1141398E+08
      0.3298360E+06  0.2902920E+06
      0.3298360E+06  0.1718490E+06
      0.2902920E+06  0.1718490E+06
      0.2415666E+07  0.1637297E+07
      0.2415666E+07  0.1347629E+07
      0.1637297E+07  0.1347629E+07
      0.9904356E+08  0.9530938E+08
      0.1049126E+09  0.9530938E+08
      0.1049126E+09  0.9904356E+08
      0.4930919E+08  0.4662120E+08
      0.4934958E+08  0.4662120E+08
      0.4934958E+08  0.4930919E+08
      0.1278483E+08  0.1232513E+08
      0.1286868E+08  0.1232513E+08
      0.1286868E+08  0.1278483E+08
      0.7029193E+07  0.4878485E+07
      0.7029193E+07  0.3244763E+07
      0.4878485E+07  0.3244763E+07
      0.1490000E+07  0.1040000E+07
      0.1860000E+07  0.1040000E+07
      0.1860000E+07  0.1490000E+07
      0.2680523E+07  0.2601516E+07
      0.2724237E+07  0.2601516E+07
      0.2724237E+07  0.2680523E+07
      0.8905137E+07  0.8303097E+07
      0.8905137E+07  0.8271071E+07
      0.8303097E+07  0.8271071E+07
      0.6956520E+06  0.6798450E+06
      0.6921780E+06  0.6798450E+06
      0.6956520E+06  0.6921780E+06
      0.3290000E+09  0.2890000E+09
      0.3300000E+09  0.2890000E+09
      0.3300000E+09  0.3290000E+09
      0.7091179E+05  0.6553055E+05
      0.7443393E+05  0.6553055E+05
      0.7443393E+05  0.7091179E+05
      0.8031739E+08  0.5416613E+08
      0.8031739E+08  0.4975062E+08
      0.5416613E+08  0.4975062E+08
      0.6830980E+07  0.6738330E+07
      0.6973430E+07  0.6738330E+07
      0.6973430E+07  0.6830980E+07
      0.2010000E+07  0.1980000E+07
      0.2600000E+07  0.2010000E+07
      0.2600000E+07  0.1980000E+07
      0.3193846E+08  0.3059341E+08
      0.3222820E+08  0.3059341E+08
      0.3222820E+08  0.3193846E+08
      0.1784258E+08  0.1460987E+08
      0.1784258E+08  0.1099276E+08
      0.1460987E+08  0.1099276E+08
      0.3150562E+09  0.3052555E+09
      0.3150562E+09  0.2994084E+09
      0.3052555E+09  0.2994084E+09
      0.7998000E+08  0.7574000E+08
      0.8017000E+08  0.7574000E+08
      0.8017000E+08  0.7998000E+08
      0.3983000E+08  0.3886000E+08
      0.4086000E+08  0.3886000E+08
      0.4086000E+08  0.3983000E+08
      0.2334030E+07  0.1387010E+07
      0.2544590E+07  0.2334030E+07
      0.2544590E+07  0.1387010E+07
      0.3126721E+09  0.2310785E+09
      0.2490103E+09  0.2310785E+09
      0.3126721E+09  0.2490103E+09
      0.1000900E+03  0.9977000E+02
      0.1255000E+03  0.9977000E+02
      0.1255000E+03  0.1000900E+03
      0.9860323E+04  0.9400626E+04
      0.9882525E+04  0.9400626E+04
      0.9882525E+04  0.9860323E+04
      0.2548997E+04  0.2482806E+04
      0.2640000E+08  0.2510000E+08
      0.2680000E+08  0.2510000E+08
      0.2680000E+08  0.2640000E+08
    end of data
    .
    set write decimals 4
    .
    . Step 2:   Large sample interval
    .
    set ratio of means method large sample
    ratio of means confidence limit y x
        
    The following output is generated
                Confidence Limits for the Ratio of Means
                  (Large Sample Approximation Method)
     
    Numerator Variable:   Y
    Denominator Variable: X
     
     
    Summary Statistics for Numerator Variable:
    Number of Observations:                                82
    Sample Mean:                                98726120.5989
    Sample Standard Deviation:                 251637033.8336
    Sample Coefficient of Variation:                   2.5488
     
    Summary Statistics for Variable 2:
    Number of Observations:                                82
    Sample Mean:                                92451883.4744
    Sample Standard Deviation:                 243574789.7088
    Sample Coefficient of Variation:                   2.6346
     
    Correlation:                                       0.9988
     
     
     
    ---------------------------------------------------------
      Confidence                         Lower          Upper
       Value (%)          Ratio          Limit          Limit
    ---------------------------------------------------------
          50.000         1.0679         1.0557         1.0800
          75.000         1.0679         1.0470         1.0887
          90.000         1.0679         1.0380         1.0978
          95.000         1.0679         1.0321         1.1036
          99.000         1.0679         1.0205         1.1153
          99.900         1.0679         1.0065         1.1292
          99.990         1.0679         0.9943         1.1414
          99.999         1.0679         0.9832         1.1525
        
    . set ratio of means method log ratio ratio of means confidence limit y x The following output is generated
                Confidence Limits for the Ratio of Means
                           (Log Ratio Method)
     
    Numerator Variable:   Y
    Denominator Variable: X
     
     
    Summary Statistics for Numerator Variable:
    Number of Observations:                                82
    Sample Mean:                                98726120.5989
    Sample Standard Deviation:                 251637033.8336
    Sample Coefficient of Variation:                   2.5488
     
    Summary Statistics for Variable 2:
    Number of Observations:                                82
    Sample Mean:                                92451883.4744
    Sample Standard Deviation:                 243574789.7088
    Sample Coefficient of Variation:                   2.6346
     
    Correlation:                                       0.9988
     
     
     
    ---------------------------------------------------------
      Confidence                         Lower          Upper
       Value (%)          Ratio          Limit          Limit
    ---------------------------------------------------------
          50.000         1.0679         1.0558         1.0801
          75.000         1.0679         1.0472         1.0889
          90.000         1.0679         1.0384         1.0982
          95.000         1.0679         1.0327         1.1042
          99.000         1.0679         1.0215         1.1163
          99.900         1.0679         1.0082         1.1310
          99.990         1.0679         0.9968         1.1440
          99.999         1.0679         0.9865         1.1560
        
    . set ratio of means method fieler ratio of means confidence limit y x The following output is generated
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   99.99000    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
    ***** WARNING: RATIO OF MEANS CONFIDENCE LIMITS--
          FOR ALPHA (   99.99900    ), THE FIELLER INTERVAL IS UNBOUNDED.
     
                Confidence Limits for the Ratio of Means
                            (Fieller Method)
     
    Numerator Variable:   Y
    Denominator Variable: X
     
     
    Summary Statistics for Numerator Variable:
    Number of Observations:                                82
    Sample Mean:                                98726120.5989
    Sample Standard Deviation:                 251637033.8336
    Sample Coefficient of Variation:                   2.5488
     
    Summary Statistics for Variable 2:
    Number of Observations:                                82
    Sample Mean:                                92451883.4744
    Sample Standard Deviation:                 243574789.7088
    Sample Coefficient of Variation:                   2.6346
     
    Correlation:                                       0.9988
     
     
     
    ---------------------------------------------------------
      Confidence                         Lower          Upper
       Value (%)          Ratio          Limit          Limit
    ---------------------------------------------------------
          50.000         1.0679         1.0568         1.0818
          75.000         1.0679         1.0499         1.0951
          90.000         1.0679         1.0430         1.1148
          95.000         1.0679         1.0386         1.1334
          99.000         1.0679         1.0293         1.2096
          99.900         1.0679         1.0154         6.5994
          99.990         1.0679             **             **
          99.999         1.0679             **             **
     
        
Date created: 02/04/2020
Last updated: 12/11/2023

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