# Horvitz–Thompson estimator

In statistics, the Horvitz–Thompson estimator, named after Daniel G. Horvitz and Donovan J. Thompson, is a method for estimating the total and mean of a pseudo-population in a stratified sample by applying inverse probability weighting to account for the difference in the sampling distribution between the collected data and the target population. The Horvitz–Thompson estimator is frequently applied in survey analyses and can be used to account for missing data, as well as many sources of unequal selection probabilities.

## The method

Formally, let $Y_{i},i=1,2,\ldots ,n$ be an independent sample from $n$ of $N\geq n$ distinct strata with an overall mean $\mu$. Suppose further that $\pi _{i}$ is the inclusion probability that a randomly sampled individual in a superpopulation belongs to the $i$th stratum. The Horvitz–Thompson estimator of the total is given by:$^{:51}$
    ${\hat {Y}}_{\mathrm {HT} }=\sum _{i=1}^{n}{\frac {Y_{i}}{\pi _{i}}},$
and the Horvitz–Thompson estimate of the mean is given by:
    ${\hat {\mu }}_{\mathrm {HT} }={\frac {1}{N}}{\hat {Y}}_{HT}={\frac {1}{N}}\sum _{i=1}^{n}{\frac {Y_{i}}{\pi _{i}}}.$
In a Bayesian probabilistic framework $\pi _{i}$ is considered the proportion of individuals in a target population belonging to the $i$th stratum. Hence, $Y_{i}/\pi _{i}$ could be thought of as an estimate of the complete sample of persons within the $i$th stratum. The Horvitz–Thompson estimator can also be expressed as the limit of a weighted bootstrap resampling estimate of the mean. It can also be viewed as a special case of multiple imputation approaches.
For post-stratified study designs, estimation of $\pi$ and $\mu$ are done in distinct steps. In such cases, computating the variance of ${\hat {\mu }}_{HT}$ is not straightforward. Resampling techniques such as the bootstrap or the jackknife can be applied to gain consistent estimates of the variance of the Horvitz–Thompson estimator. The "survey" package for R conducts analyses for post-stratified data using the Horvitz–Thompson estimator.

## Proof of Horvitz–Thompson unbiased estimation of the mean

For this proof it will be useful to represent the sample as a random subset $S\subseteq \{1,\ldots ,N\}$ of size $n$. We can then define indicator random variables $I_{j}=\mathbf {1} [j\in S]$ representing whether for each $j$ in $\{1,\ldots ,N\}$ whether it is present in the sample. Note that for any observation in the sample, the expectation is the definition of the inclusion probability: $\pi _{i}=\operatorname {\mathbb {E} } \left(I_{i}\right)=\Pr(i\in S)$.
Taking the expectation of the estimator we can prove it is unbiased as follows:
    ${\begin{aligned}\operatorname {\mathbb {E} } \left({\hat {\mu }}_{\mathrm {HT} }\right)&=\operatorname {\mathbb {E} } \left({\frac {1}{N}}\sum _{i\in S}{\frac {Y_{i}}{\pi _{i}}}\right)\\[6pt]&=\operatorname {\mathbb {E} } \left({\frac {1}{N}}\sum _{j=1}^{N}{\frac {Y_{j}}{\pi _{j}}}I_{j}\right)\\[6pt]&={\frac {1}{N}}\sum _{j=1}^{N}{\frac {Y_{j}}{\pi _{j}}}\operatorname {\mathbb {E} } \left(I_{j}\right)\\&={\frac {1}{N}}\sum _{j=1}^{N}{\frac {Y_{j}}{\pi _{j}}}\pi _{j}\\[6pt]&={\frac {1}{N}}\sum _{j=1}^{N}Y_{i}\end{aligned}}$
The Hansen–Hurwitz (1943) is known to be inferior to the Horvitz–Thompson (1952) strategy, associated with a number of Inclusion Probabilities Proportional to Size (IPPS) sampling procedures.