BarLev {RRTCS} | R Documentation |
BarLev model
Description
Computes the randomized response estimation, its variance estimation and its confidence interval through the BarLev model. The function can also return the transformed variable. The BarLev model was proposed by Bar-Lev et al. in 2004.
Usage
BarLev(z,p,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Arguments
z |
vector of the observed variable; its length is equal to |
p |
probability of direct response |
mu |
mean of the scramble variable |
sigma |
standard deviation of the scramble variable |
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 i
is
z_i=\left\{\begin{array}{lcc}
y_i & \textrm{with probability } p\\
y_iS & \textrm{with probability } 1-p\\
\end{array}
\right.
where S
is a scramble variable, whose mean \mu
and standard deviation \sigma
are known.
Value
Point and confidence estimates of the sensitive characteristics using the BarLev model. The transformed variable is also reported, if required.
References
Bar-Lev S.K., Bobovitch, E., Boukai, B. (2004). A note on randomized response models for quantitative data. Metrika, 60, 255-260.
See Also
Examples
data(BarLevData)
dat=with(BarLevData,data.frame(z,Pi))
p=0.6
mu=1
sigma=1
cl=0.95
BarLev(dat$z,p,mu,sigma,dat$Pi,"total",cl)