**D****escription:**

Rates are commonly estimated statistically with the ratio of additive aggregates, such as the ratio of sums, or averages. There are three principle reasons driving the use of ratios of estimates: first, they lend themselves to interpretation; second, they are very easy to compute; and third, despite being non-parametric estimators, they are also maximum likelihood estimators for any family of distribution that has a parameter that can be expressed as the ratio of expectations. To compare rate estimates from different samples we require a non-parametric estimate of the standard error of the the ratio of estimators, which in turn requires a non-parametric estimate of the variance of the ratio. Fortunately the delta method, and a bit of multi-variate vector calculus, provides the asymptotic variance of the ratio of estimators.

Without going into details that exceed the interests, or expertise of the audience, we begin by considering *n* independent identical observations of pairs of real randoms variable *X _{i}* and

*Y*, each with finite non-trivial expectation, variance, and potentially non-trivial co-variance. For example, in estimating the age dependent mortality hazard,

_{i}*Y*would be the age at which patient

_{i}*i*was last observed, and

*X*would indicate whether the patient was deceased at the latest observation. We are then interested in estimating the variance of the ratio of the sums, or equivalently the averages, of these observations.

_{i}In the example the ratio *R _{n}* would estimate the deaths per patient year. The crux of formulating the asymptotic variance of

*R*is recognising that we need to calculate the gradient of the function

_{n}*r(x,y)=x/y*, which yields [

*1/y , -x/y*]

^{2}^{T}. The asymptotic variance then readily simplifies to a tractable product, note the intentional absence of indices on the right hand side of the equation.

Taking the square root of the previous equation, substituting in the usual unbiased estimators for the mean, and using a one degree of freedom penalty in estimating the square yields the standard error.

The product terms of this formulation of the standard error has an elegant interpretation. The first term is the **scale factor** of the standard error, in that it assures the standard error is of the same scale as the ratio of the estimators. The second term is the **degrees of freedom penalty**, which inflates the standard error because we are estimating both the mean and the mean of the squares. The final term is the **normalized sampling discount** which takes into account both the similarity between the normalized random variables, and the improvement in estimation with larger sample sizes, technically the *L _{p}^{2}* distance between the

*L*normalized variables

_{p}^{1}*X*and

*Y*, over probability measure

*p*.

Remarkably, this asymptotic estimator of the standard error is nearly a prototypical example of the use of empty INCLUDE level of detail calculations, only surpassed by computing record level standard scores. In this case we need a calculated field that contains the ratio of the value at a single record (the *i* index) divided by the sum over records in the same dimension (the *j* index).

**Example Calculation:**

We begin by assuming we have measures [X] and [Y], and have a calculated measure estimating the rate [R] := ZN(SUM([X])/SUM([Y])), and further that we have exactly one record per observation. We estimate the standard error of [R] using the following aggregate, with two embedded empty INCLUDE level of detail calculations.

// The use of ZN is not the best way to handle having less than two observations,

// however in that case the rate estimator is technically zero while the standard

// error is infinite.

[Standard Error] := ZN

(

// The scale factor, ensures the standard error has the same scale as the ratio

ABS(SUM([X])/SUM([Y])) *

SQRT

(

// The normalized sampling discount, renormalizes each observation by the sum of observations.

// Note the use of the empty INCLUDE level of detail, to automatically calculate over the

// dimensions of the sheet.

SUM(([X] / { INCLUDE : SUM([X]) } - [Y] / { INCLUDE : SUM([Y]) })^2) *

// The degrees of freedom penalty, from estimating both the sum, and the sum of squares

SUM([Number of Records]) /

(SUM([Number of Records]) - 1)

)

)

**Comments:**

Care must be taken with the use of the empty INCLUDE level of detail calculation, as it is a source of brittleness in the implementation of the asymptotic standard error of rate estimators. As well the sample size, *n*, is not necessarily naively the number of records. In the example presented, if the patients were observed through multiple censuses then the sample size is not the total observations, but rather the number of unique patients, because each patient can contribute only one observation of death.

**Related Functions:**

SUM, SQRT, ABS, ZN, and INCLUDE.

*Further Reading/Examples:*

The delta method of asymptotic variance calculation is the foundation of the propagation of uncertainties methods widely used in the physical sciences. A small example will be attached shortly.

## Comments