EichhornHayre: Eichhorn-Hayre model

Description Usage Arguments Details Value References See Also Examples

View source: R/EichhornHayre.R

Description

Computes the randomized response estimation, its variance estimation and its confidence interval through the Eichhorn-Hayre model. The function can also return the transformed variable. The Eichhorn-Hayre model was proposed by Eichhorn and Hayre in 1983.

Usage

1
EichhornHayre(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)

Arguments

z

vector of the observed variable; its length is equal to n (the sample size)

mu

mean of the scramble variable S

sigma

standard deviation of the scramble variable S

pi

vector of the first-order inclusion probabilities

type

the estimator type: total or mean

cl

confidence level

N

size of the population. By default it is NULL

pij

matrix of the second-order inclusion probabilities. By default it is NULL

Details

The randomized response given by the person labelled i is z_i=y_iS where S is a scramble variable whose distribution is assumed to be known.

Value

Point and confidence estimates of the sensitive characteristics using the Eichhorn-Hayre model. The transformed variable is also reported, if required.

References

Eichhorn, B.H., Hayre, L.S. (1983). Scrambled randomized response methods for obtaining sensitive quantitative data. Journal of Statistical Planning and Inference, 7, 306-316.

See Also

EichhornHayreData

ResamplingVariance

Examples

1
2
3
4
5
6
7
8
data(EichhornHayreData)
dat=with(EichhornHayreData,data.frame(z,Pi))
mu=1.111111
sigma=0.5414886
cl=0.95
#This line returns a warning showing why the variance estimation is not possible.
#See ResamplingVariance for several alternatives.
EichhornHayre(dat$z,mu,sigma,dat$Pi,"mean",cl)

RRTCS documentation built on April 21, 2021, 9:06 a.m.