HTestimator | R Documentation |
Computes the Horvitz-Thompson estimator of the population total.
HTestimator(y,pik)
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. |
UPtille
data(belgianmunicipalities)
attach(belgianmunicipalities)
# inclusion probabilities
pik=inclusionprobabilities(Tot04,200)
N=length(pik)
n=sum(pik)
# draws a Poisson sample of expected size 200
s=UPpoisson(pik)
# Horvitz-Thompson estimator of the total of TaxableIncome
HTestimator(TaxableIncome[s==1],pik[s==1])
detach(belgianmunicipalities)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.