BarLev: BarLev model

Description Usage Arguments Details Value References See Also Examples

View source: R/BarLev.R

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

1
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 n (the sample size)

p

probability of direct response

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 i is

z_i=≤ft\{\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 μ and standard deviation σ 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

BarLevData

ResamplingVariance

Examples

1
2
3
4
5
6
7
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)

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