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

ratioest

The ratio estimator


Description

Computes the ratio estimator of the population total.

Usage

ratioest(y,x,Tx,pik)

Arguments

y

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

x

vector of auxiliary information; its length is equal to n, the sample size.

Tx

population total of x.

pik

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

Value

The function returns the value of the ratio estimator.

See Also

Examples

data(MU284)
# there are 3 outliers which are deleted from the population
MU281=MU284[MU284$RMT85<=3000,]
attach(MU281)
# computes the inclusion probabilities using the variable P85; sample size 120
pik=inclusionprobabilities(P85,120)
# defines the variable of interest
y=RMT85
# defines the auxiliary information
x=CS82
# draws a systematic sample of size 120
s=UPsystematic(pik)
# computes the ratio estimator
ratioest(y[s==1],x[s==1],sum(x),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.