CovHT: Covariance estimator between two Horvitz - Thompson...

Description Usage Arguments Details Value References See Also Examples

Description

Computes the covariance estimator between two Horvitz - Thompson estimators of population total from survey data obtained from a single stage sampling design

Usage

1
CovHT(y, x, pikl)

Arguments

y

A numeric vector of size n containing information about first variable of interest in the sample

x

A numeric vector of size n containing information about second variable of interest in the sample

pikl

A square numeric matrix of dimension n containing first and second order inclusion probabilities for units included in the sample

Details

Covariance estimator between two Horvitz - Thompson estimators of population total is given by

\hat{Cov}(\hat{Y}_{HT}, \hat{X}_{HT}) = ∑_{k \in s}∑_{l \in s} \frac{π_{kl} - π_k π_l}{π_{kl}}\frac{y_k}{π_k}\frac{x_l}{π_l}

Value

A numeric value representing covariance estimator between two Horvitz - Thompson estimators for population total for considered values

References

Horvitz, D. G. and Thompson, D. J. (1952) A generalization of sampling without replacement from a finite universe. Journal of the American Statistical Association, 47, 663 - 685 @references Sarndal, C. E., Swensson, B. and Wretman, J. (1992) Model Assisted Survey Sampling. Springer-Verlag. New York.

See Also

HT VarHT

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##########   Example 1   ##########
Indicators <- c(1, 2, 3, 4, 5)
X <- c(13, 18, 20, 14, 9)
Y <- c(2, 0.5, 1.2, 3.3, 2)
#Let draw two simple random samples without replacement of size 2
s <- sample(Indicators, 2)
sX <- X[s]
sY <- Y[s]
#Now, let calculate the associated probability matrix with first and
#second order inclusion probabilities
Ps <- matrix(c(0.4,0.2, 0.2,0.4), 2, 2)
CovHT(sX, sY, Ps)

##########   Example 2   ##########
data(DatA)
attach(DatA)
data(PiklA)
#Let calculate Horvitz - Thompson estimator for total of variable Clothing in Frame A.
HT(Clo, ProbA)
#Let calculate Horvitz - Thompson estimator for total of variable Feeding in Frame A.
HT(Feed, ProbA)
#And now, let compute the covariance between the previous estimators
CovHT(Clo, Feed, PiklA)

Example output

Attaching package: 'Frames2'

The following object is masked from 'package:methods':

    Compare

[1] 312.875
[1] 52971.8
[1] 429884.8
[1] -294540.4

Frames2 documentation built on May 2, 2019, 8:13 a.m.