Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

HTestimator

The Horvitz-Thompson estimator


Description

Computes the Horvitz-Thompson estimator of the population total.

Usage

HTestimator(y,pik)

Arguments

y

vector of the variable of interest; its length is equal to n, the sample size.

pik

vector of the first-order inclusion probabilities; its length is equal to n, the sample size.

See Also

Examples

data(belgianmunicipalities)
attach(belgianmunicipalities)
# Computes the inclusion probabilities
pik=inclusionprobabilities(Tot04,200)
N=length(pik)
n=sum(pik)
# Defines the variable of interest
y=TaxableIncome
# Draws a Poisson sample of expected size 200
s=UPpoisson(pik)
# Computes the Horvitz-Thompson estimator
HTestimator(y[s==1],pik[s==1])

sampling

Survey Sampling

v2.9
GPL (>= 2)
Authors
Yves Till<e9> <yves.tille@unine.ch>, Alina Matei <alina.matei@unine.ch>
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.