Description Usage Arguments Details Value References See Also Examples
View source: R/EichhornHayre.R
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.
1 |
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 |
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.
Point and confidence estimates of the sensitive characteristics using the Eichhorn-Hayre model. The transformed variable is also reported, if required.
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.