Weighted arithmetic mean
The weighted arithmetic mean is similar to an ordinary arithmetic mean, except that instead of each of the data points contributing equally to the final average, some data points contribute more than others. The notion of weighted mean plays a role in descriptive statistics and also occurs in a more general form in several other areas of mathematics.
If all the weights are equal, then the weighted mean is the same as the arithmetic mean. While weighted means generally behave in a similar fashion to arithmetic means, they do have a few counterintuitive properties, as captured for instance in Simpson's paradox.
Examples
Basic example
Given two school with 20 students, one with 30 test grades in each class as follows:The mean for the morning class is 80 and the mean of the afternoon class is 90. The unweighted mean of the two means is 85. However, this does not account for the difference in number of students in each class ; hence the value of 85 does not reflect the average student grade. The average student grade can be obtained by averaging all the grades, without regard to classes :
Or, this can be accomplished by weighting the class means by the number of students in each class. The larger class is given more "weight":
Thus, the weighted mean makes it possible to find the mean average student grade without knowing each student's score. Only the class means and the number of students in each class are needed.
Convex combination example
Since only the relative weights are relevant, any weighted mean can be expressed using coefficients that sum to one. Such a linear combination is called a convex combination.Using the previous example, we would get the following weights:
Then, apply the weights like this:
Mathematical definition
Formally, the weighted mean of a non-empty finite tuple of data,with corresponding non-negative weights is
which expands to:
Therefore, data elements with a high weight contribute more to the weighted mean than do elements with a low weight. The weights may not be negative in order for the equation to work. Some may be zero, but not all of them.
The formulas are simplified when the weights are normalized such that they sum up to 1, i.e.,.
For such normalized weights, the weighted mean is equivalently:
One can always normalize the weights by making the following transformation on the original weights:
The ordinary mean is a special case of the weighted mean where all data have equal weights.
If the data elements are independent and identically distributed random variables with variance, the standard error of the weighted mean,, can be shown via uncertainty propagation to be:
Variance-defined weights
For the weighted mean of a list of data for which each element potentially comes from a different probability distribution with known variance, all having the same mean, one possible choice for the weights is given by the reciprocal of variance:The weighted mean in this case is:
and the standard error of the weighted mean is:
Note this reduces to when all.
It is a special case of the general formula in previous section,
The equations above can be combined to obtain:
The significance of this choice is that this weighted mean is the maximum likelihood estimator of the mean of the probability distributions under the assumption that they are independent and normally distributed with the same mean.
Statistical properties
Expectancy
The weighted sample mean,, is itself a random variable. Its expected value and standard deviation are related to the expected values and standard deviations of the observations, as follows. For simplicity, we assume normalized weights.If the observations have expected values
then the weighted sample mean has expectation
In particular, if the means are equal,, then the expectation of the weighted sample mean will be that value,
Variance
Simple i.i.d. case
When treating the weights as constants, and having a sample of n observations from uncorrelated random variables, all with the same variance and expectation, then the variance of the weighted mean can be estimated as the multiplication of the unweighted variance by Kish's design effect :With,, and
However, this estimation is rather limited due to the strong assumption about the y observations. This has led to the development of alternative, more general, estimators.
Survey sampling perspective
From a model based perspective, we are interested in estimating the variance of the weighted mean when the different are not i.i.d random variables. An alternative perspective for this problem is that of some arbitrary sampling design of the data in which units are selected with unequal probabilities.In Survey methodology, the population mean, of some quantity of interest y, is calculated by taking an estimation of the total of y over all elements in the population and dividing it by the population size – either known or estimated. In this context, each value of y is considered constant, and the variability comes from the selection procedure. This in contrast to "model based" approaches in which the randomness is often described in the y values. The survey sampling procedure yields a series of Bernoulli indicator values that get 1 if some observation i is in the sample and 0 if it was not selected. This can occur with fixed sample size, or varied sample size sampling. The probability of some element to be chosen, given a sample, is denoted as, and the one-draw probability of selection is . For the following derivation we'll assume that the probability of selecting each element is fully represented by these probabilities. I.e.: selecting some element will not influence the probability of drawing another element.
Since each element is fixed, and the randomness comes from it being included in the sample or not, we often talk about the multiplication of the two, which is a random variable. To avoid confusion in the following section, let's call this term:. With the following expectancy: ; and variance:.
When each element of the sample is inflated by the inverse of its selection probability, it is termed the -expanded y values, i.e.:. A related quantity is -expanded y values:. As above, we can add a tick mark if multiplying by the indicator function. I.e.:
In this design based perspective, the weights, used in the numerator of the weighted mean, are obtained from taking the inverse of the selection probability. I.e.:.
Variance of the weighted sum (''pwr''-estimator for totals)
If the population size N is known we can estimate the population mean using.If the sampling design is one that results in a fixed sample size n, then the variance of this estimator is:
An alternative term, for when the sampling has a random sample size, is presented in Sarndal et al. as:
With. Also, where is the probability of selecting both i and j. And, and for i=j:.
If the selection probability are uncorrelated, and when assuming the probability of each element is very small, then:
Variance of the weighted mean (-estimator for ratio-mean)
The previous section dealt with estimating the population mean as a ratio of an estimated population total with a known population size, and the variance was estimated in that context. Another common case is that the population size itself is unknown and is estimated using the sample. The estimation of can be described as the sum of weights. So when we get. With the above notation, the parameter we care about is the ratio of the sums of s, and 1s. I.e.:. We can estimate it using our sample with:. As we moved from using N to using n, we actually know that all the indicator variables get 1, so we could simply write:. This will be the estimand for specific values of y and w, but the statistical properties comes when including the indicator variable.This is called a Ratio estimator and it is approximately unbiased for R.
In this case, the variability of the ratio depends on the variability of the random variables both in the numerator and the denominator - as well as their correlation. Since there is no closed analytical form to compute this variance, various methods are used for approximate estimation. Primarily Taylor series first-order linearization, asymptotics, and bootstrap/jackknife. The Taylor linearization method could lead to under-estimation of the variance for small sample sizes in general, but that depends on the complexity of the statistic. For the weighted mean, the approximate variance is supposed to be relatively accurate even for medium sample sizes. For when the sampling has a random sample size, it is as follows:
If, then either using or would give the same estimator, since multiplying by some factor would lead to the same estimator. It also means that if we scale the sum of weights to be equal to a known-from-before population size N, the variance calculation would look the same. When all weights are equal to one another, this formula is reduced to the standard unbiased variance estimator.
We have two versions of variance for the weighted mean: one with known and one with unknown population size estimation. There is no uniformly better approach, but the literature presents several arguments to prefer using the population estimation version. For example: if all y values are constant, the estimator with unknown population size will give the correct result, while the one with known population size will have some variability. Also, when the sample size itself is random, the version with unknown population mean is considered more stable. Lastly, if the proportion of sampling is negatively correlated with the values, then the un-known population size version slightly compensates for that.
For the trivial case in which all the weights are equal to 1, the above formula is just like the regular formula for the variance of the mean.