# Ratio estimator

The ratio estimator is a statistical estimator for the ratio of means of two random variables. Ratio estimates are biased and corrections must be made when they are used in experimental or survey work. The ratio estimates are asymmetrical and symmetrical tests such as the t test should not be used to generate confidence intervals.
The bias is of the order O(1/n) (see big O notation) so as the sample size (n) increases, the bias will asymptotically approach 0. Therefore, the estimator is approximately unbiased for large sample sizes.

## Definition

Assume there are two characteristics – x and y – that can be observed for each sampled element in the data set. The ratio R is
    $R={\bar {\mu }}_{y}/{\bar {\mu }}_{x}$
The ratio estimate of a value of the y variate (θ$_y$) is
    $\theta _{y}=R\theta _{x}$
where θ$_x$ is the corresponding value of the x variate. θ$_y$ is known to be asymptotically normally distributed.

## Statistical properties

The sample ratio (r) is estimated from the sample
    $r={\frac {\bar {y}}{\bar {x}}}={\frac {\sum _{i=1}^{n}y_{i}}{\sum _{i=1}^{n}x_{i}}}$
That the ratio is biased can be shown with Jensen's inequality as follows (assuming independence between ${\bar {x}}$ and ${\bar {y}}$):
    $E\left({\frac {\bar {y}}{\bar {x}}}\right)=E\left({\bar {y}}{\frac {1}{\bar {x}}}\right)=E({\bar {y}})E\left({\frac {1}{\bar {x}}}\right)\geq E({\bar {y}}){\frac {1}{E({\bar {x}})}}={\frac {E({\bar {y}})}{E({\bar {x}})}}={\frac {E(y)}{E(x)}}={\frac {m_{y}}{m_{x}}}$
where $m_{x}$ is the mean of the variate $x$ and $m_{y}$ is the mean of the variate $y$.
Under simple random sampling the bias is of the order O( n$^{−1}$ ). An upper bound on the relative bias of the estimate is provided by the coefficient of variation (the ratio of the standard deviation to the mean). Under simple random sampling the relative bias is O( n$^{−1/2}$ ).

### Correction of the mean's bias

The correction methods, depending on the distributions of the x and y variates, differ in their efficiency making it difficult to recommend an overall best method. Because the estimates of r are biased a corrected version should be used in all subsequent calculations.
A correction of the bias accurate to the first order is
    $r_{\mathrm {corr} }=r-{\frac {s_{xy}}{m_{x}}}$
where m$_x$ is the mean of the variate x and s$_{xy}$ is the covariance between x and y.
To simplify the notation s$_{xy}$ will be used subsequently to denote the covariance between the variates x and y.
Another estimator based on the Taylor expansion is
    $r_{\mathrm {corr} }=r-(1-{\frac {n-1}{N-1}}){\frac {rs_{x}^{2}-s_{xy}}{nm_{x}^{2}}}$
where n is the sample size, N is the population size, m$_x$ is the mean of the x variate and s$_x$$^2$ and s$_y$$^2$ are the sample variances of the x and y variates respectively.
A computationally simpler but slightly less accurate version of this estimator is
    $r_{\mathrm {corr} }=r-{\frac {N-n}{N}}{\frac {rs_{x}^{2}-s_{xy}}{nm_{x}^{2}}}$
where N is the population size, n is the sample size, m$_x$ is the mean of the x variate and s$_x$$^2$ and s$_y$$^2$ are the sample variances of the x and y variates respectively. These versions differ only in the factor in the denominator (N - 1). For a large N the difference is negligible.
If x and y are unitless counts with Poisson distribution a second-order correction is
    $r_{\mathrm {corr} }=r\left[1+{\frac {1}{n}}\left({\frac {1}{m_{x}}}-{\frac {s_{xy}}{m_{x}m_{y}}}\right)+{\frac {1}{n^{2}}}\left({\frac {2}{m_{x}^{2}}}-{\frac {s_{xy}}{m_{x}m_{y}}}\left[2+{\frac {3}{m_{x}}}\right]+{\frac {s_{x^{2}y}}{m_{x}^{2}m_{y}}}\right)\right]$
Other methods of bias correction have also been proposed. To simplify the notation the following variables will be used
    $\theta ={\frac {1}{n}}-{\frac {1}{N}}$
    $c_{x}^{2}={\frac {s_{x}^{2}}{m_{x}^{2}}}$
    $c_{xy}={\frac {s_{xy}}{m_{x}m_{y}}}$
Pascual's estimator:
    $r_{\mathrm {corr} }=r+{\frac {N-1}{N}}{\frac {m_{y}-rm_{x}}{n-1}}$
Beale's estimator:
    $r_{\mathrm {corr} }=r{\frac {1+\theta c_{xy}}{1+\theta c_{x}^{2}}}$
Tin's estimator:
    $r_{\mathrm {corr} }=r\left(1+\theta \left(c_{xy}-c_{x}^{2}\right)\right)$
Sahoo's estimator:
    $r_{\mathrm {corr} }={\frac {r}{1+\theta (c_{x}^{2}-c_{xy})}}$
Sahoo has also proposed a number of additional estimators:
    $r_{\mathrm {corr} }=r(1+\theta c_{xy})(1-\theta c_{x}^{2})$
    $r_{\mathrm {corr} }={\frac {r(1-\theta c_{x}^{2})}{1-\theta c_{xy}}}$
    $r_{\mathrm {corr} }={\frac {r}{(1-\theta c_{xy})(1+\theta c_{x}^{2})}}$
If x and y are unitless counts with Poisson distribution and m$_x$ and m$_y$ are both greater than 10, then the following approximation is correct to order O( n$^{−3}$ ).
    $r_{\mathrm {corr} }=r\left[1-{\frac {2}{n^{2}m_{x}}}\left({\frac {1}{m_{x}}}-{\frac {s_{xy}}{m_{x}m_{y}}}\right)\left(1+{\frac {13}{2n}}+{\frac {8}{nm_{x}}}\right)\right]$
An asymptotically correct estimator is
    $r_{\mathrm {corr} }=r+c_{x}^{2}{\frac {m_{y}}{m_{x}}}-{\frac {s_{xy}}{m_{x}^{2}}}$

## Jackknife estimation

A jackknife estimate of the ratio is less biased than the naive form. A jackknife estimator of the ratio is
    $r_{\mathrm {corr} }=nr-{\frac {n-1}{n}}\sum _{i\neq j=1}^{n}r_{i}$
where n is the size of the sample and the r$_i$ are estimated with the omission of one pair of variates at a time.
An alternative method is to divide the sample into g groups each of size p with n = pg. Let r$_i$ be the estimate of the ith group. Then the estimator
    $r_{\mathrm {corr} }=gr-{\frac {g-1}{g}}\sum _{i=1}^{g}r_{i}=g\left(r-{\bar {r}}\right)+{\bar {r}}$
where ${\bar {r}}$ is the mean of the ratios r$_g$ of the g groups, has a bias of at most O( n$^{−2}$ ).
Other estimators based on the division of the sample into g groups are:
    $r_{\mathrm {corr} }={\frac {g}{g+1}}r-{\frac {1}{g(g-1)}}\sum _{i=1}^{g}r_{i}$
    $r_{\mathrm {corr} }={\bar {r}}+{\frac {n}{n-1}}{\frac {m_{y}-{\bar {r}}m_{x}}{m_{x}}}$
    $r_{\mathrm {corr} }={\bar {r_{g}}}+{\frac {g(m_{y}-{\bar {r_{g}}}m_{x})}{m_{x}}}$
where ${\bar {r}}$ is the mean of the ratios r$_g$ of the g groups and
    ${\bar {r_{g}}}=\sum {\frac {r_{i}'}{g}}$
where r$_i$$^'$ is the value of the sample ratio with the ith group omitted.

### Other methods of estimation

Other methods of estimating a ratio estimator include maximum likelihood and bootstrapping.

## Estimate of total

The estimated total of the y variate ( τ$_y$ ) is
    $\tau _{y}=r\tau _{x}$
where ( τ$_x$ ) is the total of the x variate.

## Variance estimates

The variance of the sample ratio is approximately:
    $\operatorname {var} (r)={\frac {1}{s_{x}^{2}+m_{x}^{2}}}\left[(s_{y}^{2}-s_{x^{2}[y^{2}/x^{2}]})-(s_{x[y/x]})^{2}+2m_{y}s_{x[y/x]}-{\frac {s_{x}^{2}}{m_{x}^{2}}}(m_{y}-s_{x[y/x]}^{2})\right]$
where s$_x$$^2$ and s$_y$$^2$ are the variances of the x and y variates respectively, m$_x$ and m$_y$ are the means of the x and y variates respectively and s$_{xy}$ is the covariance of x and y.
Although the approximate variance estimator of the ratio given below is biased, if the sample size is large, the bias in this estimator is negligible.
    $\operatorname {var} (r)={\frac {1}{n}}{\frac {N-n}{N}}{\frac {1}{m_{x}^{2}}}{\frac {\sum _{i=1}^{n}(y_{i}-rx_{i})^{2}}{n-1}}$
where N is the population size, n is the sample size and m$_x$ is the mean of the x variate.
Another estimator of the variance based on the Taylor expansion is
    $\operatorname {var} (r)={\frac {1}{n}}(1-{\frac {n-1}{N-1}}){\frac {r^{2}s_{x}^{2}+s_{y}^{2}-2rs_{xy}}{m_{x}^{2}}}$
where n is the sample size and N is the population size and s$_{xy}$ is the covariance of x and y.
An estimate accurate to O( n$^{−2}$ ) is
    $\operatorname {var} (r)={\frac {1}{n}}\left[{\frac {s_{y}^{2}}{m_{x}^{2}}}+{\frac {m_{y}^{2}s_{x}^{2}}{m_{x}^{4}}}-{\frac {2m_{y}s_{xy}}{m_{x}^{3}}}\right]$
If the probability distribution is Poissonian, an estimator accurate to O( n$^{−3}$ ) is
    $\operatorname {var} (r)=r^{2}\left[{\frac {1}{n}}\left({\frac {1}{m_{x}}}+{\frac {1}{m_{y}}}-{\frac {2s_{xy}}{m_{x}m_{y}}}\right)+{\frac {1}{n^{2}}}\left({\frac {6}{m_{x}^{2}}}+{\frac {3}{m_{x}m_{y}}}+s_{xy}\left[{\frac {4}{m_{y}^{2}}}-{\frac {8}{m_{x}m_{y}}}-{\frac {16}{m_{x}^{2}m_{y}}}+{\frac {5s_{xy}}{m_{x}^{2}m_{y}^{2}}}\right]+{\frac {4s_{x^{2}y}}{m_{x}^{2}m_{y}}}-{\frac {2s_{xy^{2}}}{m_{x}m_{y}^{2}}}\right)\right]$
A jackknife estimator of the variance is
    $\operatorname {var} (r)={\frac {(n-1)}{n}}\sum _{i=1}^{n}(r_{i}-r_{J})^{2}$
where r$_i$ is the ratio with the ith pair of variates omitted and r$_J$ is the jackknife estimate of the ratio.

### Variance of total

The variance of the estimated total is
    $\operatorname {var} (\tau _{y})=\tau _{y}^{2}\operatorname {var} (r)$

### Variance of mean

The variance of the estimated mean of the y variate is
    $\operatorname {var} ({\bar {y}})=m_{x}^{2}\operatorname {var} (r)={\frac {N-n}{N}}{\frac {\sum _{i=1}^{n}(y_{i}-rx_{i})^{2}}{n-1}}={\frac {N-n}{N}}{\frac {(s_{y}^{2}+r^{2}s_{x}^{2}-2rs_{xy})}{n}}$
where m$_x$ is the mean of the x variate, s$_x$$^2$ and s$_y$$^2$ are the sample variances of the x and y variates respectively and s$_{xy}$ is the covariance of x and y.

## Skewness

The skewness and the kurtosis of the ratio depend on the distributions of the x and y variates. Estimates have been made of these parameters for normally distributed x and y variates but for other distributions no expressions have yet been derived. It has been found that in general ratio variables are skewed to the right, are leptokurtic and their nonnormality is increased when magnitude of the denominator's coefficient of variation is increased.
For normally distributed x and y variates the skewness of the ratio is approximately
    $\gamma =\left({\frac {m_{y}\omega }{\sqrt {nm_{x}m_{y}\omega ^{2}+m_{x}^{2}m_{y}}}}\right)\left(6+{\frac {1}{nm_{x}}}\left[44+{\frac {1}{1+\omega ^{2}m_{y}/m_{x}}}\right]\right)$
where
    $\omega =1-m_{x}\operatorname {cov} (x,y)$

### Effect on confidence intervals

Because the ratio estimate is generally skewed confidence intervals created with the variance and symmetrical tests such as the t test are incorrect. These confidence intervals tend to overestimate the size of the left confidence interval and underestimate the size of the right.
If the ratio estimator is unimodal (which is frequently the case) then a conservative estimate of the 95% confidence intervals can be made with the Vysochanskiï–Petunin inequality.

## Alternative methods of bias reduction

An alternative method of reducing or eliminating the bias in the ratio estimator is to alter the method of sampling. The variance of the ratio using these methods differs from the estimates given previously. Note that while many applications such as those discussion in Lohr are intended to be restricted to positive integers only, such as sizes of sample groups, the Midzuno-Sen method works for any sequence of positive numbers, integral or not. It's not clear what it means that Lahiri's method works since it returns a biased result.

### Lahiri's method

The first of these sampling schemes is a double use of a sampling method introduced by Lahiri in 1951. The algorithm here is based upon the description by Lohr.
* Choose a number M = max( x$_1$, ..., x$_N$) where N is the population size.
* Choose i at random from a uniform distribution on [1,N].
* Choose k at random from a uniform distribution on [1,M].
* If k ≤ x$_i$, then x$_i$ is retained in the sample. If not then it is rejected.
* Repeat this process from step 2 until the desired sample size is obtained.
The same procedure for the same desired sample size is carried out with the y variate.
Lahiri's scheme as described by Lohr is biased high and, so, is interesting only for historical reasons. The Midzuno-Sen technique described below is recommended instead.

### Midzuno-Sen's method

In 1952 Midzuno and Sen independently described a sampling scheme that provides an unbiased estimator of the ratio.
The first sample is chosen with probability proportional to the size of the x variate. The remaining n - 1 samples are chosen at random without replacement from the remaining N - 1 members in the population. The probability of selection under this scheme is
    $P={\frac {\sum x_{i}}{{N-1 \choose n-1}X}}$
where X is the sum of the N x variates and the x$_i$ are the n members of the sample. Then the ratio of the sum of the y variates and the sum of the x variates chosen in this fashion is an unbiased estimate of the ratio estimator.
In symbols we have
    $r={\frac {\sum y_{i}}{\sum x_{i}}}$
where x$_i$ and y$_i$ are chosen according to the scheme described above.
The ratio estimator given by this scheme is unbiased.
Särndal, Swensson, and Wretman credit Lahiri, Midzuno and Sen for the insights leading to this method but Lahiri's technique is biased high.

### Other ratio estimators

Tin (1965) described and compared ratio estimators proposed by Beale (1962) and Quenouille (1956) and proposed a modified approach (now referred to as Tin's method). These ratio estimators are commonly used to calculate pollutant loads from sampling of waterways, particularly where flow is measured more frequently than water quality. For example see Quilbe et al., (2006)

## Ordinary least squares regression

If a linear relationship between the x and y variates exists and the regression equation passes through the origin then the estimated variance of the regression equation is always less than that of the ratio estimator. The precise relationship between the variances depends on the linearity of the relationship between the x and y variates: when the relationship is other than linear the ratio estimate may have a lower variance than that estimated by regression.

## Uses

Although the ratio estimator may be of use in a number of settings it is of particular use in two cases:
* when the variates x and y are highly correlated through the origin.
* In survey methodology when estimating a weighted average in which the denominator indicates the sum of weights that reflect the total population size, but the total population size is unknown.

## History

The first known use of the ratio estimator was by John Graunt in England who in 1662 was the first to estimate the ratio y/x where y represented the total population and x the known total number of registered births in the same areas during the preceding year.
Later Messance (~1765) and Moheau (1778) published very carefully prepared estimates for France based on enumeration of population in certain districts and on the count of births, deaths and marriages as reported for the whole country. The districts from which the ratio of inhabitants to birth was determined only constituted a sample.
In 1802, Laplace wished to estimate the population of France. No population census had been carried out and Laplace lacked the resources to count every individual. Instead he sampled 30 parishes whose total number of inhabitants was 2,037,615. The parish baptismal registrations were considered to be reliable estimates of the number of live births so he used the total number of births over a three-year period. The sample estimate was 71,866.333 baptisms per year over this period giving a ratio of one registered baptism for every 28.35 persons. The total number of baptismal registrations for France was also available to him and he assumed that the ratio of live births to population was constant. He then used the ratio from his sample to estimate the population of France.
Karl Pearson said in 1897 that the ratio estimates are biased and cautioned against their use.