
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.
EichhornHayre(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
vector of the observed variable; its length is equal to
mean of the scramble variable
standard deviation of the scramble variable
vector of the first-order inclusion probabilities
the estimator type: total or mean
confidence level
size of the population. By default it is NULL
matrix of the second-order inclusion probabilities. By default it is NULL
Point and confidence estimates of the sensitive characteristics using the Eichhorn-Hayre model. The transformed variable is also reported, if required.
The randomized response given by the person labelled
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.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab