Title: | Randomized Response Techniques for Complex Surveys |
---|---|
Description: | Point and interval estimation of linear parameters with data obtained from complex surveys (including stratified and clustered samples) when randomization techniques are used. The randomized response technique was developed to obtain estimates that are more valid when studying sensitive topics. Estimators and variances for 14 randomized response methods for qualitative variables and 7 randomized response methods for quantitative variables are also implemented. In addition, some data sets from surveys with these randomization methods are included in the package. |
Authors: | Beatriz Cobo Rodríguez, María del Mar Rueda García, Antonio Arcos Cebrián |
Maintainer: | Beatriz Cobo Rodríguez <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.4 |
Built: | 2024-12-14 06:35:33 UTC |
Source: | CRAN |
The aim of this package is to calculate point and interval estimation for linear parameters with data obtained from randomized response surveys. Twenty one RR methods are implemented for complex surveys:
- Randomized response procedures to estimate parameters of a qualitative stigmatizing characteristic: Christofides model, Devore model, Forced-Response model, Horvitz model, Horvitz model with unknown B, Kuk model, Mangat model, Mangat model with unknown B, Mangat-Singh model, Mangat-Singh-Singh model, Mangat-Singh-Singh model with unknown B, Singh-Joarder model, SoberanisCruz model and Warner model.
- Randomized response procedures to estimate parameters of a quantitative stigmatizing characteristic: BarLev model, Chaudhuri-Christofides model, Diana-Perri-1 model, Diana-Perri-2 model, Eichhorn-Hayre model, Eriksson model and Saha model.
Using the usual notation in survey sampling, we consider a finite population , consisting of
different elements.
Let
be the value of the sensitive aspect under study for the
th population element. Our aim is to estimate the finite population total
of the variable of interest
or the population mean
. If we can estimate the
proportion of the population presenting a certain stigmatized behaviour
, the variable
takes the value 1 if
(the group with the stigmatized behaviour) and the value zero otherwise. Some qualitative models use an innocuous or related attribute
whose
population proportion can be known or unknown.
Assume that a sample is chosen according to a general design
with inclusion probabilities
.
In order to include a wide variety of RR procedures, we consider the unified approach given by Arnab (1994). The interviews of individuals in the sample
are conducted in accordance with the RR model. For each
the RR induces a random response
(denoted scrambled response) so that the revised
randomized response
(Chaudhuri and Christofides, 2013) is an unbiased estimation of
. Then, an unbiased estimator for the population total of
the sensitive characteristic
is given by
The variance of this estimator is given by:
where is the variance of
under the randomized device and
is the design-variance of the Horvitz Thompson estimator
of
values.
This variance is estimated by:
where varies with the RR device and the estimation of the design-variance,
, is obtained using Deville's method
(Deville, 1993).
The confidence interval at % level is given by
where denotes the
% quantile of a standard normal distribution.
Similarly, an unbiased estimator for the population mean is given by
and an unbiased estimator for its variance is calculated as:
In cases where the population size is unknown, we consider Hàjek-type estimators for the mean:
and Taylor-series linearization variance estimation of the ratio (Wolter, 2007) is used.
In qualitative models, the values and
for
are described in each model.
In some quantitative models, the values and
for
are calculated in a general form (Arcos et al, 2015) as follows:
The randomized response given by the person is
with and where
and
are scramble variables whose distributions are assumed to be known. We denote by
and
respectively the mean and standard deviation of the variable
.
The transformed variable is
its variance is
where
and the estimated variance is
Some of the quantitative techniques considered can be viewed as particular cases of the above described procedure. Other models are described in the respective function.
Alternatively, the variance can be estimated using certain resampling methods.
Beatriz Cobo Rodríguez, Department of Statistics and Operations Research. University of Granada [email protected]
María del Mar Rueda García, Department of Statistics and Operations Research. University of Granada [email protected]
Antonio Arcos Cebrián, Department of Statistics and Operations Research. University of Granada [email protected]
Maintainer: Beatriz Cobo Rodríguez [email protected]
Arcos, A., Rueda, M., Singh, S. (2015). A generalized approach to randomised response for quantitative variables. Quality and Quantity 49, 1239-1256.
Arnab, R. (1994). Non-negative variance estimator in randomized response surveys. Comm. Stat. Theo. Math. 23, 1743-1752.
Chaudhuri, A., Christofides, T.C. (2013). Indirect Questioning in Sample Surveys Springer-Verlag Berlin Heidelberg.
Deville, J.C. (1993). Estimation de la variance pour les enquêtes en deux phases. Manuscript, INSEE, Paris.
Wolter, K.M. (2007). Introduction to Variance Estimation. 2nd Edition. Springer.
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.
BarLev(z,p,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
BarLev(z,p,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
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 |
The randomized response given by the person is
where is a scramble variable, whose mean
and standard deviation
are known.
Point and confidence estimates of the sensitive characteristics using the BarLev model. The transformed variable is also reported, if required.
Bar-Lev S.K., Bobovitch, E., Boukai, B. (2004). A note on randomized response models for quantitative data. Metrika, 60, 255-260.
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)
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)
This data set contains observations from a randomized response survey conducted in a population of 2396 industrial companies in a city to investigate their income.
The sample is drawn by stratified sampling with probabilities proportional to the size of the company.
The randomized response technique used is the BarLev model (Bar-Lev et al, 2004) with parameter and scramble variable
.
data(BarLevData)
data(BarLevData)
A data frame containing 370 observations of a sample of companies divided into three strata. The variables are:
ID: Survey ID
ST: Strata ID
z: The randomized response to the question: What was the company's income in the previous fiscal year?
Pi: first-order inclusion probabilities
Bar-Lev S.K., Bobovitch, E., Boukai, B. (2004). A note on randomized response models for quantitative data. Metrika, 60, 255-260.
data(BarLevData)
data(BarLevData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Chaudhuri-Christofides model. The function can also return the transformed variable. The Chaudhuri-Christofides model can be seen in Chaudhuri and Christofides (2013, page 97).
ChaudhuriChristofides(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
ChaudhuriChristofides(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
mu |
vector with the means of the scramble variables |
sigma |
vector with the standard deviations of the scramble variables |
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 is
where
are scramble variables, whose mean
and
standard deviation
are known.
Point and confidence estimates of the sensitive characteristics using the Chaudhuri-Christofides model. The transformed variable is also reported, if required.
Chaudhuri, A., and Christofides, T.C. (2013) Indirect Questioning in Sample Surveys. Springer-Verlag Berlin Heidelberg.
N=417 data(ChaudhuriChristofidesData) dat=with(ChaudhuriChristofidesData,data.frame(z,Pi)) mu=c(6,6) sigma=sqrt(c(10,10)) cl=0.95 data(ChaudhuriChristofidesDatapij) ChaudhuriChristofides(dat$z,mu,sigma,dat$Pi,"mean",cl,pij=ChaudhuriChristofidesDatapij)
N=417 data(ChaudhuriChristofidesData) dat=with(ChaudhuriChristofidesData,data.frame(z,Pi)) mu=c(6,6) sigma=sqrt(c(10,10)) cl=0.95 data(ChaudhuriChristofidesDatapij) ChaudhuriChristofides(dat$z,mu,sigma,dat$Pi,"mean",cl,pij=ChaudhuriChristofidesDatapij)
This data set contains observations from a randomized response survey conducted in a population of 417 individuals in a municipality to investigate the agricultural subsidies.
The sample is drawn by sampling with unequal probabilities (probability proportional to agricultural subsidies in the previous year).
The randomized response technique used is the Chaudhuri-Christofides model (Chaudhuri and Christofides, 2013) with scramble variables and
.
data(ChaudhuriChristofidesData)
data(ChaudhuriChristofidesData)
A data frame containing 100 observations. The variables are:
ID: Survey ID
z: The randomized response to the question: What are your annual agricultural subsidies?
Pi: first-order inclusion probabilities
Chaudhuri, A., and Christofides, T.C. (2013) Indirect Questioning in Sample Surveys. Springer-Verlag Berlin Heidelberg.
data(ChaudhuriChristofidesData)
data(ChaudhuriChristofidesData)
This dataset consists of a square matrix of dimension 100 with the first and second order inclusion probabilities
for the units included in sample , drawn from a population of size
according to a
sampling with unequal probabilities (probability proportional to agricultural subsidies in the previous year).
data(ChaudhuriChristofidesDatapij)
data(ChaudhuriChristofidesDatapij)
data(ChaudhuriChristofidesDatapij) #Now, let select only the first-order inclusion probabilities diag(ChaudhuriChristofidesDatapij)
data(ChaudhuriChristofidesDatapij) #Now, let select only the first-order inclusion probabilities diag(ChaudhuriChristofidesDatapij)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Christofides model. The function can also return the transformed variable. The Christofides model was proposed by Christofides in 2003.
Christofides(z,mm,pm,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Christofides(z,mm,pm,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
mm |
vector with the marks of the cards |
pm |
vector with the probabilities of previous marks |
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 |
In the Christofides randomized response technique, a sampled person is given a box with identical cards, each bearing a separate mark as
with
but in known proportions
with
for
and
. The person sampled is requested to draw one of the cards and respond
The transformed variable is where
and the estimated variance is
, where
.
Point and confidence estimates of the sensitive characteristics using the Christofides model. The transformed variable is also reported, if required.
Christofides, T.C. (2003). A generalized randomized response technique. Metrika, 57, 195-200.
N=802 data(ChristofidesData) dat=with(ChristofidesData,data.frame(z,Pi)) mm=c(1,2,3,4,5) pm=c(0.1,0.2,0.3,0.2,0.2) cl=0.95 Christofides(dat$z,mm,pm,dat$Pi,"mean",cl,N)
N=802 data(ChristofidesData) dat=with(ChristofidesData,data.frame(z,Pi)) mm=c(1,2,3,4,5) pm=c(0.1,0.2,0.3,0.2,0.2) cl=0.95 Christofides(dat$z,mm,pm,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate eating disorders.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Christofides model (Christofides, 2003) with parameters, and
.
data(ChristofidesData)
data(ChristofidesData)
A data frame containing 150 observations from a population of students. The variables are:
ID: Survey ID of student respondent
z: The randomized response to the question: Do you have problems of anorexia or bulimia?
Pi: first-order inclusion probabilities
Christofides, T.C. (2003). A generalized randomized response technique. Metrika, 57, 195-200.
data(ChristofidesData)
data(ChristofidesData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Devore model. The function can also return the transformed variable. The Devore model was proposed by Devore in 1977.
Devore(z,p,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Devore(z,p,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of cards bearing the mark |
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 |
In the Devore model, the randomized response device presents to the sampled person labelled a box containing a large number of identical cards with a
proportion
bearing the mark
and the rest marked
(an innocuous attribute). The response solicited denoted by
takes the value
if
bears
and the card drawn is marked
. Otherwise
takes the value 1.
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Devore model. The transformed variable is also reported, if required.
Devore, J.L. (1977). A note on the randomized response technique. Communications in Statistics Theory and Methods 6: 1525-1529.
data(DevoreData) dat=with(DevoreData,data.frame(z,Pi)) p=0.7 cl=0.95 Devore(dat$z,p,dat$Pi,"total",cl)
data(DevoreData) dat=with(DevoreData,data.frame(z,Pi)) p=0.7 cl=0.95 Devore(dat$z,p,dat$Pi,"total",cl)
This data set contains observations from a randomized response survey conducted in a university to investigate the use of instant messaging.
The sample is drawn by stratified sampling by academic year.
The randomized response technique used is the Devore model (Devore, 1977) with parameter .
The unrelated question is: Are you alive?
data(DevoreData)
data(DevoreData)
A data frame containing 240 observations divided into four strata. The sample is selected from a population of students.
The variables are:
ID: Survey ID of student respondent
ST: Strata ID
z: The randomized response to the question: Do you use whatsapp / line or similar instant messaging while you study?
Pi: first-order inclusion probabilities
Devore, J.L. (1977). A note on the randomized response technique. Communications in Statistics Theory and Methods 6: 1525-1529.
data(DevoreData)
data(DevoreData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Diana-Perri-1 model. The function can also return the transformed variable. The Diana-Perri-1 model was proposed by Diana and Perri (2010, page 1877).
DianaPerri1(z,p,mu,pi,type=c("total","mean"),cl,N=NULL,method="srswr")
DianaPerri1(z,p,mu,pi,type=c("total","mean"),cl,N=NULL,method="srswr")
z |
vector of the observed variable; its length is equal to |
p |
probability of direct response |
mu |
vector with the means of the scramble variables |
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 |
method |
method used to draw the sample: srswr or srswor. By default it is srswr |
In the Diana-Perri-1 model let be a design parameter, controlled by the experimenter, which is used to randomize the response as follows: with probability
the interviewer responds with the true value of the sensitive variable, whereas with probability
the respondent gives a coded value,
where
are scramble variables whose distribution is assumed to be known.
To estimate a sample of respondents is selected according to simple random sampling with replacement.
The transformed variable is
where are the means of
scramble variables, respectively.
The estimated variance in this model is
where .
If the sample is selected by simple random sampling without replacement, the estimated variance is
Point and confidence estimates of the sensitive characteristics using the Diana-Perri-1 model. The transformed variable is also reported, if required.
Diana, G., Perri, P.F. (2010). New scrambled response models for estimating the mean of a sensitive quantitative character. Journal of Applied Statistics 37 (11), 1875-1890.
N=417 data(DianaPerri1Data) dat=with(DianaPerri1Data,data.frame(z,Pi)) p=0.6 mu=c(5/3,5/3) cl=0.95 DianaPerri1(dat$z,p,mu,dat$Pi,"mean",cl,N,"srswor")
N=417 data(DianaPerri1Data) dat=with(DianaPerri1Data,data.frame(z,Pi)) p=0.6 mu=c(5/3,5/3) cl=0.95 DianaPerri1(dat$z,p,mu,dat$Pi,"mean",cl,N,"srswor")
This data set contains observations from a randomized response survey conducted in a population of 417 individuals in a municipality to investigate defrauded taxes.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Diana and Perri 1 model (Diana and Perri, 2010) with parameters ,
and
.
data(DianaPerri1Data)
data(DianaPerri1Data)
A data frame containing 150 observations from a population of .
The variables are:
ID: Survey ID
z: The randomized response to the question: What quantity of your agricultural subsidy do you declare in your income tax return?
Pi: first-order inclusion probabilities
Diana, G., Perri, P.F. (2010). New scrambled response models for estimating the mean of a sensitive quantitative character. Journal of Applied Statistics 37 (11), 1875–1890.
data(DianaPerri1Data)
data(DianaPerri1Data)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Diana-Perri-2 model. The function can also return the transformed variable. The Diana-Perri-2 model was proposed by Diana and Perri (2010, page 1879).
DianaPerri2(z,mu,beta,pi,type=c("total","mean"),cl,N=NULL,method="srswr")
DianaPerri2(z,mu,beta,pi,type=c("total","mean"),cl,N=NULL,method="srswr")
z |
vector of the observed variable; its length is equal to |
mu |
vector with the means of the scramble variables |
beta |
the constant of weighting |
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 |
method |
method used to draw the sample: srswr or srswor. By default it is srswr |
In the Diana-Perri-2 model, each respondent is asked to report the scrambled response where
is a suitable constant
controlled by the researcher and
are scramble variables whose distribution is assumed to be known.
To estimate a sample of respondents is selected according to simple random sampling with replacement.
The transformed variable is
where are the means of
scramble variables, respectively.
The estimated variance in this model is
where .
If the sample is selected by simple random sampling without replacement, the estimated variance is
Point and confidence estimates of the sensitive characteristics using the Diana-Perri-2 model. The transformed variable is also reported, if required.
Diana, G., Perri, P.F. (2010). New scrambled response models for estimating the mean of a sensitive quantitative character. Journal of Applied Statistics 37 (11), 1875-1890.
N=100000 data(DianaPerri2Data) dat=with(DianaPerri2Data,data.frame(z,Pi)) beta=0.8 mu=c(50/48,5/3) cl=0.95 DianaPerri2(dat$z,mu,beta,dat$Pi,"mean",cl,N,"srswor")
N=100000 data(DianaPerri2Data) dat=with(DianaPerri2Data,data.frame(z,Pi)) beta=0.8 mu=c(50/48,5/3) cl=0.95 DianaPerri2(dat$z,mu,beta,dat$Pi,"mean",cl,N,"srswor")
This data set contains observations from a simulated randomized response survey.
The interest variable is a normal distribution with mean 1500 and standard deviation 4.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Diana and Perri 2 model (Diana and Perri, 2010) with parameters and
.
data(DianaPerri2Data)
data(DianaPerri2Data)
A data frame containing 1000 observations from a population of .
The variables are:
ID: Survey ID
z: The randomized response
Pi: first-order inclusion probabilities
Diana, G., Perri, P.F. (2010). New scrambled response models for estimating the mean of a sensitive quantitative character. Journal of Applied Statistics 37 (11), 1875–1890.
data(DianaPerri2Data)
data(DianaPerri2Data)
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)
EichhornHayre(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
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 |
The randomized response given by the person labelled is
where
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.
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)
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)
This data set contains observations from a randomized response survey conducted in a population of families to investigate their income.
The sample is drawn by stratified sampling by house ownership.
The randomized response technique used is the Eichhorn and Hayre model (Eichhorn and Hayre, 1983) with scramble variable .
data(EichhornHayreData)
data(EichhornHayreData)
A data frame containing 150 observations of a sample extracted from a population of families divided into two strata. The variables are:
ID: Survey ID
ST: Strata ID
z: The randomized response to the question: What is the annual household income?
Pi: first-order inclusion probabilities
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.
data(EichhornHayreData)
data(EichhornHayreData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Eriksson model. The function can also return the transformed variable. The Eriksson model was proposed by Eriksson in 1973.
Eriksson(z,p,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Eriksson(z,p,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
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 |
The randomized response given by the person labelled is
with probability
and a discrete uniform variable
with probabilities
verifying
.
Point and confidence estimates of the sensitive characteristics using the Eriksson model. The transformed variable is also reported, if required.
Eriksson, S.A. (1973). A new model for randomized response. International Statistical Review 41, 40-43.
N=53376 data(ErikssonData) dat=with(ErikssonData,data.frame(z,Pi)) p=0.5 mu=mean(c(0,1,3,5,8)) sigma=sqrt(4/5*var(c(0,1,3,5,8))) cl=0.95 Eriksson(dat$z,p,mu,sigma,dat$Pi,"mean",cl,N)
N=53376 data(ErikssonData) dat=with(ErikssonData,data.frame(z,Pi)) p=0.5 mu=mean(c(0,1,3,5,8)) sigma=sqrt(4/5*var(c(0,1,3,5,8))) cl=0.95 Eriksson(dat$z,p,mu,sigma,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate cheating behaviour in exams.
The sample is drawn by stratified sampling by university faculty with uniform allocation.
The randomized response technique used is the Eriksson model (Eriksson, 1973) with parameter and
a discrete uniform variable at the points (0,1,3,5,8).
The data were used by Arcos et al. (2015).
data(ErikssonData)
data(ErikssonData)
A data frame containing 102 students of a sample extracted from a population of divided into four strata.
The variables are:
ID: Survey ID of student respondent
ST: Strata ID
z: The randomized response to the question: How many times have you cheated in an exam in the past year?
Pi: first-order inclusion probabilities
Arcos, A., Rueda, M. and Singh, S. (2015). A generalized approach to randomised response for quantitative variables. Quality and Quantity 49, 1239-1256.
Eriksson, S.A. (1973). A new model for randomized response. International Statistical Review 41, 40-43.
data(ErikssonData)
data(ErikssonData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Forced-Response model. The function can also return the transformed variable. The Forced-Response model was proposed by Boruch in 1972.
ForcedResponse(z,p1,p2,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
ForcedResponse(z,p1,p2,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p1 |
proportion of cards marked "Yes" |
p2 |
proportion of cards marked "No" |
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 |
In the Forced-Response scheme, the sampled person is offered a box with cards: some are marked "Yes" with a proportion
, some are marked "No" with a
proportion
and the rest are marked "Genuine", in the remaining proportion
, where
. The person is
requested to randomly draw one of them, to observe the mark on the card, and to respond
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Forced-Response model. The transformed variable is also reported, if required.
Boruch, R.F. (1972). Relations among statistical methods for assuring confidentiality of social research data. Social Science Research, 1, 403-414.
data(ForcedResponseData) dat=with(ForcedResponseData,data.frame(z,Pi)) p1=0.2 p2=0.2 cl=0.95 ForcedResponse(dat$z,p1,p2,dat$Pi,"total",cl) #Forced Response with strata data(ForcedResponseDataSt) dat=with(ForcedResponseDataSt,data.frame(ST,z,Pi)) p1=0.2 p2=0.2 cl=0.95 ForcedResponse(dat$z,p1,p2,dat$Pi,"total",cl)
data(ForcedResponseData) dat=with(ForcedResponseData,data.frame(z,Pi)) p1=0.2 p2=0.2 cl=0.95 ForcedResponse(dat$z,p1,p2,dat$Pi,"total",cl) #Forced Response with strata data(ForcedResponseDataSt) dat=with(ForcedResponseDataSt,data.frame(ST,z,Pi)) p1=0.2 p2=0.2 cl=0.95 ForcedResponse(dat$z,p1,p2,dat$Pi,"total",cl)
This data set contains observations from a randomized response survey obtained from a simulated population.
The main variable is a binomial distribution with a probability 0.5.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Forced Response model (Boruch, 1972) with parameters and
.
data(ForcedResponseData)
data(ForcedResponseData)
A data frame containing 1000 observations from a population of . The variables are:
ID: Survey ID
z: The randomized response
Pi: first-order inclusion probabilities
Boruch, R.F. (1972). Relations among statistical methods for assuring confidentiality of social research data. Social Science Research, 1, 403-414.
data(ForcedResponseData)
data(ForcedResponseData)
This data set contains observations from a randomized response survey to determine the prevalence of infertility among women of childbearing age in a population-base study.
The sample is drawn by stratified sampling.
The randomized response technique used is the Forced Response model (Boruch, 1972) with parameters and
.
data(ForcedResponseDataSt)
data(ForcedResponseDataSt)
A data frame containing 442 observations. The variables are:
ID: Survey ID
ST: Strata ID
z: The randomized response to the question: Did you ever have some medical treatment for the infertility?
Pi: first-order inclusion probabilities
Boruch, R.F. (1972). Relations among statistical methods for assuring confidentiality of social research data. Social Science Research, 1, 403-414.
data(ForcedResponseDataSt)
data(ForcedResponseDataSt)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Horvitz model. The function can also return the transformed variable. The Horvitz model was proposed by Horvitz et al. (1967) and by Greenberg et al. (1969).
Horvitz(z,p,alpha,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Horvitz(z,p,alpha,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive question |
alpha |
proportion of people with the innocuous attribute |
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 |
In the Horvitz model, the randomized response device presents to the sampled person labelled a box containing a large number of identical cards, with a
proportion
bearing the mark
and the rest marked
(an innocuous attribute whose population proportion
is known).
The response solicited denoted by
takes the value
if
bears
and the card drawn is marked
or if
bears
and the card drawn is marked
. Otherwise
takes the value 0.
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Horvitz model. The transformed variable is also reported, if required.
Greenberg, B.G., Abul-Ela, A.L., Simmons, W.R., Horvitz, D.G. (1969). The unrelated question RR model: Theoretical framework. Journal of the American Statistical Association, 64, 520-539.
Horvitz, D.G., Shah, B.V., Simmons, W.R. (1967). The unrelated question RR model. Proceedings of the Social Statistics Section of the American Statistical Association. 65-72. Alexandria, VA: ASA.
N=10777 data(HorvitzData) dat=with(HorvitzData,data.frame(z,Pi)) p=0.5 alpha=0.6666667 cl=0.95 Horvitz(dat$z,p,alpha,dat$Pi,"mean",cl,N) #Horvitz real survey N=10777 n=710 data(HorvitzDataRealSurvey) p=0.5 alpha=1/12 pi=rep(n/N,n) cl=0.95 Horvitz(HorvitzDataRealSurvey$sex,p,alpha,pi,"mean",cl,N)
N=10777 data(HorvitzData) dat=with(HorvitzData,data.frame(z,Pi)) p=0.5 alpha=0.6666667 cl=0.95 Horvitz(dat$z,p,alpha,dat$Pi,"mean",cl,N) #Horvitz real survey N=10777 n=710 data(HorvitzDataRealSurvey) p=0.5 alpha=1/12 pi=rep(n/N,n) cl=0.95 Horvitz(HorvitzDataRealSurvey$sex,p,alpha,pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate bullying.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Horvitz model (Horvitz et al., 1967 and Greenberg et al., 1969) with parameter .
The unrelated question is: Were you born between the 1st and 20th of the month? with
.
data(HorvitzData)
data(HorvitzData)
A data frame containing a sample of 411 observations from a population of students.
The variables are:
ID: Survey ID of student respondent
z: The randomized response to the question: Have you been bullied?
Pi: first-order inclusion probabilities
Greenberg, B.G., Abul-Ela, A.L., Simmons, W.R., Horvitz, D.G. (1969). The unrelated question RR model: Theoretical framework. Journal of the American Statistical Association, 64, 520-539.
Horvitz, D.G., Shah, B.V., Simmons, W.R. (1967). The unrelated question RR model. Proceedings of the Social Statistics Section of the American Statistical Association. 65-72. Alexandria, VA: ASA.
data(HorvitzData)
data(HorvitzData)
This data set contains observations from a randomized response survey conducted in a university to sensitive questions described below.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Horvitz model (Horvitz et al., 1967 and Greenberg et al., 1969) with parameter .
Each sensitive question is associated with a unrelated question.
1. Were you born in July? with
2. Does your ID number end in 2? with
3. Were you born of 1 to 20 of the month? with
4. Does your ID number end in 5? with
5. Were you born of 15 to 25 of the month? with
6. Were you born in April? with
data(HorvitzData)
data(HorvitzData)
A data frame containing a sample of 710 observations from a population of students.
The variables are:
copied: The randomized response to the question: Have you ever copied in an exam?
fought: The randomized response to the question: Have you ever fought with a teacher?
bullied: The randomized response to the question: Have you been bullied?
bullying: The randomized response to the question: Have you ever bullied someone?
drug: The randomized response to the question: Have you ever taken drugs on the campus?
sex: The randomized response to the question: Have you had sex on the premises of the university?
Greenberg, B.G., Abul-Ela, A.L., Simmons, W.R., Horvitz, D.G. (1969). The unrelated question RR model: Theoretical framework. Journal of the American Statistical Association, 64, 520-539.
Horvitz, D.G., Shah, B.V., Simmons, W.R. (1967). The unrelated question RR model. Proceedings of the Social Statistics Section of the American Statistical Association. 65-72. Alexandria, VA: ASA.
data(HorvitzDataRealSurvey)
data(HorvitzDataRealSurvey)
This data set contains observations from a randomized response survey conducted in a university to investigate the infidelity.
The sample is drawn by stratified (by faculty) cluster (by group) sampling.
The randomized response technique used is the Horvitz model (Horvitz et al., 1967 and Greenberg et al., 1969) with parameter .
The unrelated question is: Does your identity card end in an odd number? with a probability
.
data(HorvitzDataStCl)
data(HorvitzDataStCl)
A data frame containing 365 observations from a population of students divided into two strata. The first strata has 14 cluster and the second has 11 cluster.
The variables are:
ID: Survey ID of student respondent
ST: Strata ID
CL: Cluster ID
z: The randomized response to the question: Have you ever been unfaithful?
Pi: first-order inclusion probabilities
Greenberg, B.G., Abul-Ela, A.L., Simmons, W.R., Horvitz, D.G. (1969). The unrelated question RR model: Theoretical framework. Journal of the American Statistical Association, 64, 520-539.
Horvitz, D.G., Shah, B.V., Simmons, W.R. (1967). The unrelated question RR model. Proceedings of the Social Statistics Section of the American Statistical Association. 65-72. Alexandria, VA: ASA.
data(HorvitzDataStCl)
data(HorvitzDataStCl)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Horvitz model (Horvitz et al., 1967, and Greenberg et al., 1969) when the proportion of people bearing the innocuous attribute is unknown. The function can also return the transformed variable. The Horvitz-UB model can be seen in Chaudhuri (2011, page 42).
HorvitzUB(I,J,p1,p2,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
HorvitzUB(I,J,p1,p2,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
I |
first vector of the observed variable; its length is equal to |
J |
second vector of the observed variable; its length is equal to |
p1 |
proportion of marked cards with the sensitive attribute in the first box |
p2 |
proportion of marked cards with the sensitive attribute in the second box |
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 |
In the Horvitz model, when the population proportion is not known, two independent samples are taken. Two boxes are filled with a large number of similar
cards except that in the first box a proportion
of them is marked
and the complementary proportion
each bearing the mark
,
while in the second box these proportions are
and
, maintaining
different from
. A sample is chosen and every person sampled is requested
to draw one card randomly from the first box and to repeat this independently with the second box. In the first case, a randomized response should be given, as
and the second case given a randomized response as
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Horvitz-UB model. The transformed variable is also reported, if required.
Chaudhuri, A. (2011). Randomized response and indirect questioning techniques in surveys. Boca Raton: Chapman and Hall, CRC Press.
Greenberg, B.G., Abul-Ela, A.L., Simmons, W.R., Horvitz, D.G. (1969). The unrelated question RR model: Theoretical framework. Journal of the American Statistical Association, 64, 520-539.
Horvitz, D.G., Shah, B.V., Simmons, W.R. (1967). The unrelated question RR model. Proceedings of the Social Statistics Section of the American Statistical Association. 65-72. Alexandria, VA: ASA.
N=802 data(HorvitzUBData) dat=with(HorvitzUBData,data.frame(I,J,Pi)) p1=0.6 p2=0.7 cl=0.95 HorvitzUB(dat$I,dat$J,p1,p2,dat$Pi,"mean",cl,N)
N=802 data(HorvitzUBData) dat=with(HorvitzUBData,data.frame(I,J,Pi)) p1=0.6 p2=0.7 cl=0.95 HorvitzUB(dat$I,dat$J,p1,p2,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate drugs use.
The sample is drawn by cluster sampling with the probabilities proportional to the size.
The randomized response technique used is the Horvitz-UB model (Chaudhuri, 2011) with parameters and
.
data(HorvitzUBData)
data(HorvitzUBData)
A data frame containing a sample of 188 observations from a population of students divided into four cluster.
The variables are:
ID: Survey ID of student respondent
CL: Cluster ID
I: The first randomized response to the question: Have you ever used drugs?
J: The second randomized response to the question: Have you ever used drugs?
Pi: first-order inclusion probabilities
Chaudhuri, A. (2011). Randomized response and indirect questioning techniques in surveys. Boca Raton: Chapman and Hall, CRC Press.
Greenberg, B.G., Abul-Ela, A.L., Simmons, W.R., Horvitz, D.G. (1969). The unrelated question RR model: Theoretical framework. Journal of the American Statistical Association, 64, 520-539.
Horvitz, D.G., Shah, B.V., Simmons, W.R. (1967). The unrelated question RR model. Proceedings of the Social Statistics Section of the American Statistical Association. 65-72. Alexandria, VA: ASA.
data(HorvitzUBData)
data(HorvitzUBData)
Computes the randomized response estimation, its variance estimation and its confidence through the Kuk model. The function can also return the transformed variable. The Kuk model was proposed by Kuk in 1990.
Kuk(z,p1,p2,k,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Kuk(z,p1,p2,k,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p1 |
proportion of red cards in the first box |
p2 |
proportion of red cards in the second box |
k |
total number of cards drawn |
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 |
In the Kuk randomized response technique, the sampled person is offered two boxes. Each box contains cards that are identical exception colour, either red
or white, in sufficiently large numbers with proportions
and
in the first and
and
, in the second (
).
The person sampled is requested to use the first box, if his/her trait is
and the second box if his/her trait is
and to make
independent
draws of cards, with replacement each time. The person is asked to reports
, the number of times a red card is drawn.
The transformed variable is and the estimated variance is
,
where
and
.
Point and confidence estimates of the sensitive characteristics using the Kuk model. The transformed variable is also reported, if required.
Kuk, A.Y.C. (1990). Asking sensitive questions indirectly. Biometrika, 77, 436-438.
N=802 data(KukData) dat=with(KukData,data.frame(z,Pi)) p1=0.6 p2=0.2 k=25 cl=0.95 Kuk(dat$z,p1,p2,k,dat$Pi,"mean",cl,N)
N=802 data(KukData) dat=with(KukData,data.frame(z,Pi)) p1=0.6 p2=0.2 k=25 cl=0.95 Kuk(dat$z,p1,p2,k,dat$Pi,"mean",cl,N)
This data set contains the data from a randomized response survey conducted in a university to investigate excessive sexual activity.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Kuk model (Kuk, 1990) with parameters ,
and
.
data(KukData)
data(KukData)
A data frame containing 200 observations from a population of students. The variables are:
ID: Survey ID of student respondent
z: The randomized response to the question: Do you practice excessive sexual activity?
Pi: first-order inclusion probabilities
Kuk, A.Y.C. (1990). Asking sensitive questions indirectly. Biometrika, 77, 436-438.
data(KukData)
data(KukData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Mangat model. The function can also return the transformed variable. The Mangat model was proposed by Mangat in 1992.
Mangat(z,p,alpha,t,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Mangat(z,p,alpha,t,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive attribute in the second box |
alpha |
proportion of people with the innocuous attribute |
t |
proportion of marked cards with "True" in the first box |
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 |
In Mangat's method, there are two boxes, the first containing cards marked "True" and "RR" in proportions and
. A person drawing a
"True" marked card is asked to tell the truth about bearing
or
. A person drawing and “RR” marked card is then asked to apply Horvitz’s device
by drawing a card from a second box with cards marked
and
in proportions
and
. If an
marked card is now drawn the
truthful response will be about bearing the sensitive attribute
and otherwise about
. The true proportion of people bearing
is to be
estimated but
, the proportion of people bearing the innocuous trait
unrelated to
, is assumed to be known. The observed variable is
where
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Mangat model. The transformed variable is also reported, if required.
Mangat, N.S. (1992). Two stage randomized response sampling procedure using unrelated question. Journal of the Indian Society of Agricultural Statistics, 44, 82-87.
Computes the randomized response estimation, its variance estimation and its confidence interval through the Mangat-Singh model. The function can also return the transformed variable. The Mangat-Singh model was proposed by Mangat and Singh in 1990.
MangatSingh(z,p,t,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
MangatSingh(z,p,t,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive attribute in the second box |
t |
proportion of marked cards with "True" in the first box |
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 |
In the Mangat-Singh model, the sampled person is offered two boxes of cards. In the first box a known proportion of cards is marked "True" and the
remaining ones are marked "RR". One card is to be drawn, observed and returned to the box. If the card drawn is marked "True", then the respondent should respond "Yes"
if he/she belongs to the sensitive category, otherwise "No". If the card drawn is marked "RR", then the respondent must use the second box and draw a card from it.
This second box contains a proportion
of cards marked
and the remaining ones are marked
. If the card drawn from the second
box matches his/her status as related to the stigmatizing characteristic, he/she must respond "Yes", otherwise "No".
The randomized response from a person labelled
is assumed to be:
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Mangat-Singh model. The transformed variable is also reported, if required.
Mangat, N.S., Singh, R. (1990). An alternative randomized response procedure. Biometrika, 77, 439-442.
N=802 data(MangatSinghData) dat=with(MangatSinghData,data.frame(z,Pi)) p=0.7 t=0.55 cl=0.95 MangatSingh(dat$z,p,t,dat$Pi,"mean",cl,N)
N=802 data(MangatSinghData) dat=with(MangatSinghData,data.frame(z,Pi)) p=0.7 t=0.55 cl=0.95 MangatSingh(dat$z,p,t,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate cannabis use.
The sample is drawn by stratified sampling by academic year.
The randomized response technique used is the Mangat-Singh model (Mangat and Singh, 1990) with parameters and
.
data(MangatSinghData)
data(MangatSinghData)
A data frame containing 240 observations from a population of students divided into four strata.
The variables are:
ID: Survey ID of student respondent
ST: Strata ID
z: The randomized response to the question: Have you ever used cannabis?
Pi: first-order inclusion probabilities
Mangat, N.S., Singh, R. (1990). An alternative randomized response procedure. Biometrika, 77, 439-442.
data(MangatSinghData)
data(MangatSinghData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Mangat-Singh-Singh model. The function can also return the transformed variable. The Mangat-Singh-Singh model was proposed by Mangat, Singh and Singh in 1992.
MangatSinghSingh(z,p,alpha,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
MangatSinghSingh(z,p,alpha,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive attribute in the box |
alpha |
proportion of people with the innocuous attribute |
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 |
In the Mangat-Singh-Singh scheme, a person labelled , if sampled, is offered a box and told to answer "yes" if the person bears
. But if the person bears
then the person is to draw a card from the box with a proportion
of cards marked
and the rest marked
; if the person draws
a card marked
he/she is told to say "yes" again if he/she actually bears
; in any other case, "no" is to be answered.
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Mangat-Singh-Singh model. The transformed variable is also reported, if required.
Mangat, N.S., Singh, R., Singh, S. (1992). An improved unrelated question randomized response strategy. Calcutta Statistical Association Bulletin, 42, 277-281.
data(MangatSinghSinghData) dat=with(MangatSinghSinghData,data.frame(z,Pi)) p=0.6 alpha=0.5 cl=0.95 MangatSinghSingh(dat$z,p,alpha,dat$Pi,"total",cl)
data(MangatSinghSinghData) dat=with(MangatSinghSinghData,data.frame(z,Pi)) p=0.6 alpha=0.5 cl=0.95 MangatSinghSingh(dat$z,p,alpha,dat$Pi,"total",cl)
This data set contains observations from a randomized response survey conducted in a university to investigate internet betting.
The sample is drawn by stratified (by faculty) cluster (by group) sampling.
The randomized response technique used is the Mangat-Singh-Singh model (Mangat, Singh and Singh, 1992) with parameter .
The unrelated question is: Does your identity card end in an even number? with a probability
.
data(MangatSinghSinghData)
data(MangatSinghSinghData)
A data frame containing 802 observations from a population of students divided into eight strata. Each strata has a certain number of clusters, totalling 23. The variables are:
ID: Survey ID of student respondent
ST: Strata ID
CL: Cluster ID
z: The randomized response to the question: In the last year, did you bet on internet?
Pi: first-order inclusion probabilities
Mangat, N.S., Singh, R., Singh, S. (1992). An improved unrelated question randomized response strategy. Calcutta Statistical Association Bulletin, 42, 277-281.
data(MangatSinghSinghData)
data(MangatSinghSinghData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Mangat-Singh-Singh model (Mangat el al., 1992) when the proportion of people bearing the innocuous attribute is unknown. The function can also return the transformed variable. The Mangat-Singh-Singh-UB model can be seen in Chauduri (2011, page 54).
MangatSinghSinghUB(I,J,p1,p2,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
MangatSinghSinghUB(I,J,p1,p2,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
I |
first vector of the observed variable; its length is equal to |
J |
second vector of the observed variable; its length is equal to |
p1 |
proportion of marked cards with the sensitive attribute in the first box |
p2 |
proportion of marked cards with the sensitive attribute in the second box |
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 |
A person labelled who is chosen, is instructed to say "yes" if he/she bears
, and if not, to randomly take a card from a box containing
cards marked
in proportions
and
; they are then told to report the value
if a
-type card is chosen and he/she bears
;
otherwise he/she is told to report "No". This entire exercise is to be repeated independently with the second box with
and
-marked cards in proportions
and
. Let
the first response and
the second response for the respondent
.
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Mangat-Singh-Singh-UB model. The transformed variable is also reported, if required.
Chaudhuri, A. (2011). Randomized response and indirect questioning techniques in surveys. Boca Raton: Chapman and Hall, CRC Press.
Mangat, N.S., Singh, R., Singh, S. (1992). An improved unrelated question randomized response strategy. Calcutta Statistical Association Bulletin, 42, 277-281.
N=802 data(MangatSinghSinghUBData) dat=with(MangatSinghSinghUBData,data.frame(I,J,Pi)) p1=0.6 p2=0.8 cl=0.95 MangatSinghSinghUB(dat$I,dat$J,p1,p2,dat$Pi,"mean",cl,N)
N=802 data(MangatSinghSinghUBData) dat=with(MangatSinghSinghUBData,data.frame(I,J,Pi)) p1=0.6 p2=0.8 cl=0.95 MangatSinghSinghUB(dat$I,dat$J,p1,p2,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate overuse of the internet.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Mangat-Singh-Singh-UB model (Chaudhuri, 2011) with parameters and
.
data(MangatSinghSinghUBData)
data(MangatSinghSinghUBData)
A data frame containing 500 observations. The variables are:
ID: Survey ID of student respondent
z: The randomized response to the question: Do you spend a lot of time surfing the internet?
Pi: first-order inclusion probabilities
Chaudhuri, A. (2011). Randomized response and indirect questioning techniques in surveys. Boca Raton: Chapman and Hall, CRC Press.
Mangat, N.S., Singh, R., Singh, S. (1992). An improved unrelated question randomized response strategy. Calcutta Statistical Association Bulletin, 42, 277-281.
data(MangatSinghSinghUBData)
data(MangatSinghSinghUBData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Mangat model (Mangat, 1992) when the proportion of people bearing the innocuous attribute is unknown. The function can also return the transformed variable. The Mangat-UB model can be seen in Chaudhuri (2011, page 53).
MangatUB(I,J,p1,p2,t,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
MangatUB(I,J,p1,p2,t,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
I |
first vector of the observed variable; its length is equal to |
J |
second vector of the observed variable; its length is equal to |
p1 |
proportion of marked cards with the sensitive attribute in the second box |
p2 |
proportion of marked cards with the sensitive attribute in the third box |
t |
probability of response to the sensitive questions without using random response in the first box |
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 |
In Mangat's extended scheme, three boxes containing cards are presented to the sampled person, labelled . The first box contains cards marked "True" and "RR"
in proportions
and
, the second one contains
and
-marked cards in proportions
and
and the third box
contains
and
-marked cards in proportions
and
. The subject is requested to draw a card from the first box.
The sample respondent
is then instructed to tell the truth, using "the first box and if necessary also the second box" and next, independently, to give a second
truthful response also using "the first box and if necessary, the third box." Let
represent the first response and
the second response for
respondent
.
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Mangat-UB model. The transformed variable is also reported, if required.
Chaudhuri, A. (2011). Randomized response and indirect questioning techniques in surveys. Boca Raton: Chapman and Hall, CRC Press.
Mangat, N.S. (1992). Two stage randomized response sampling procedure using unrelated question. Journal of the Indian Society of Agricultural Statistics, 44, 82-87.
To estimate the variance of the randomized response estimators using resampling methods.
ResamplingVariance(output,pi,type=c("total","mean"),option=1,N=NULL,pij=NULL,str=NULL, clu=NULL,srswr=FALSE)
ResamplingVariance(output,pi,type=c("total","mean"),option=1,N=NULL,pij=NULL,str=NULL, clu=NULL,srswr=FALSE)
output |
output of the qualitative or quantitative method depending on the variable of interest |
pi |
vector of the first-order inclusion probabilities. By default it is NULL |
type |
the estimator type: total or mean |
option |
method used to calculate the variance (1: Jackknife, 2: Escobar-Berger, 3: Campbell-Berger-Skinner). By default it is 1 |
N |
size of the population |
pij |
matrix of the second-order inclusion probabilities. This matrix is necessary for the Escobar-Berger and Campbell-Berger-Skinner options. By default it is NULL |
str |
strata ID. This vector is necessary for the Jackknife option. By default it is NULL |
clu |
cluster ID. This vector is necessary for the Jackknife option. By default it is NULL |
srswr |
variable indicating whether sampling is with replacement. By default it is NULL |
Functions to estimate the variance under stratified, cluster and unequal probability sampling by resampling methods (Wolter, 2007). The function ResamplingVariance allows us to choose from three models:
- The Jackknife method (Quenouille, 1949)
- The Escobar-Berger method (Escobar and Berger, 2013)
- The Campbell-Berger-Skinner method (Campbell, 1980; Berger and Skinner, 2005).
The Escobar-Berger and Campbell-Berger-Skinner methods are implemented using the functions defined in samplingVarEst package:
VE.EB.SYG.Total.Hajek, VE.EB.SYG.Mean.Hajek;
VE.Jk.CBS.SYG.Total.Hajek, VE.Jk.CBS.SYG.Mean.Hajek
(see López, E., Barrios, E., 2014, for a detailed description of its use).
Note: Both methods require the matrix of the second-order inclusion probabilities. When this matrix is not an input, the program will give a warning and, by default, a jackknife method is used.
The resampling variance of the randomized response technique
Berger, Y.G., Skinner, C.J. (2005). A jackknife variance estimator for unequal probability sampling. Journal of the Royal Statistical Society B, 67, 79-89.
Campbell, C. (1980). A different view of finite population estimation. Proceedings of the Survey Research Methods Section of the American Statistical Association, 319-324.
Escobar, E.L., Berger, Y.G. (2013). A new replicate variance estimator for unequal probability sampling without replacement. Canadian Journal of Statistics 41, 3, 508-524.
López, E., Barrios, E. (2014). samplingVarEst: Sampling Variance Estimation. R package version 0.9-9. Online http://cran.r-project.org/web/packages/survey/index.html
Quenouille, M.H. (1949). Problems in Plane Sampling. The Annals of Mathematical Statistics 20, 355-375.
Wolter, K.M. (2007). Introduction to Variance Estimation. 2nd Edition. Springer.
N=417 data(ChaudhuriChristofidesData) dat=with(ChaudhuriChristofidesData,data.frame(z,Pi)) mu=c(6,6) sigma=sqrt(c(10,10)) cl=0.95 data(ChaudhuriChristofidesDatapij) out=ChaudhuriChristofides(dat$z,mu,sigma,dat$Pi,"mean",cl,pij=ChaudhuriChristofidesDatapij) out ResamplingVariance(out,dat$Pi,"mean",2,N,ChaudhuriChristofidesDatapij) #Resampling with strata data(EichhornHayreData) dat=with(EichhornHayreData,data.frame(ST,z,Pi)) mu=1.111111 sigma=0.5414886 cl=0.95 out=EichhornHayre(dat$z,mu,sigma,dat$Pi,"mean",cl) out ResamplingVariance(out,dat$Pi,"mean",1,str=dat$ST) #Resampling with cluster N=1500 data(SoberanisCruzData) dat=with(SoberanisCruzData, data.frame(CL,z,Pi)) p=0.7 alpha=0.5 cl=0.90 out=SoberanisCruz(dat$z,p,alpha,dat$Pi,"total",cl) out ResamplingVariance(out,dat$Pi,"total",2,N,samplingVarEst::Pkl.Hajek.s(dat$Pi)) #Resampling with strata and cluster N=1500 data(HorvitzDataStCl) dat=with(HorvitzDataStCl, data.frame(ST,CL,z,Pi)) p=0.6 alpha=0.5 cl=0.95 out=Horvitz(dat$z,p,alpha,dat$Pi,"mean",cl,N) out ResamplingVariance(out,dat$Pi,"mean",3,N,samplingVarEst::Pkl.Hajek.s(dat$Pi))
N=417 data(ChaudhuriChristofidesData) dat=with(ChaudhuriChristofidesData,data.frame(z,Pi)) mu=c(6,6) sigma=sqrt(c(10,10)) cl=0.95 data(ChaudhuriChristofidesDatapij) out=ChaudhuriChristofides(dat$z,mu,sigma,dat$Pi,"mean",cl,pij=ChaudhuriChristofidesDatapij) out ResamplingVariance(out,dat$Pi,"mean",2,N,ChaudhuriChristofidesDatapij) #Resampling with strata data(EichhornHayreData) dat=with(EichhornHayreData,data.frame(ST,z,Pi)) mu=1.111111 sigma=0.5414886 cl=0.95 out=EichhornHayre(dat$z,mu,sigma,dat$Pi,"mean",cl) out ResamplingVariance(out,dat$Pi,"mean",1,str=dat$ST) #Resampling with cluster N=1500 data(SoberanisCruzData) dat=with(SoberanisCruzData, data.frame(CL,z,Pi)) p=0.7 alpha=0.5 cl=0.90 out=SoberanisCruz(dat$z,p,alpha,dat$Pi,"total",cl) out ResamplingVariance(out,dat$Pi,"total",2,N,samplingVarEst::Pkl.Hajek.s(dat$Pi)) #Resampling with strata and cluster N=1500 data(HorvitzDataStCl) dat=with(HorvitzDataStCl, data.frame(ST,CL,z,Pi)) p=0.6 alpha=0.5 cl=0.95 out=Horvitz(dat$z,p,alpha,dat$Pi,"mean",cl,N) out ResamplingVariance(out,dat$Pi,"mean",3,N,samplingVarEst::Pkl.Hajek.s(dat$Pi))
Computes the randomized response estimation, its variance estimation and its confidence interval through the Saha model. The function can also return the transformed variable. The Saha model was proposed by Saha in 2007.
Saha(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,method="srswr")
Saha(z,mu,sigma,pi,type=c("total","mean"),cl,N=NULL,method="srswr")
z |
vector of the observed variable; its length is equal to |
mu |
vector with the means of the scramble variables |
sigma |
vector with the standard deviations of the scramble variables |
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 |
method |
method used to draw the sample: srswr or srswor. By default it is srswr |
In the Saha model, each respondent selected is asked to report the randomized response where
are scramble variables whose distribution
is assumed to be known.
To estimate a sample of respondents is selected according to simple random sampling with replacement.
The transformed variable is
where are the means of
scramble variables respectively
The estimated variance in this model is
where .
If the sample is selected by simple random sampling without replacement, the estimated variance is
Point and confidence estimates of the sensitive characteristics using the Saha model. The transformed variable is also reported, if required.
Saha, A. (2007). A simple randomized response technique in complex surveys. Metron LXV, 59-66.
N=228 data(SahaData) dat=with(SahaData,data.frame(z,Pi)) mu=c(1.5,5.5) sigma=sqrt(c(1/12,81/12)) cl=0.95 Saha(dat$z,mu,sigma,dat$Pi,"mean",cl,N)
N=228 data(SahaData) dat=with(SahaData,data.frame(z,Pi)) mu=c(1.5,5.5) sigma=sqrt(c(1/12,81/12)) cl=0.95 Saha(dat$z,mu,sigma,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a population of students to investigate spending on alcohol.
The sample is drawn by simple random sampling with replacement.
The randomized response technique used is the Saha model (Saha, 2007) with scramble variables and
.
data(SahaData)
data(SahaData)
A data frame containing 100 observations. The variables are:
ID: Survey ID
z: The randomized response to the queston: How much money did you spend on alcohol, last weekend?
Pi: first-order inclusion probabilities
Saha, A. (2007). A simple randomized response technique in complex surveys. Metron LXV, 59-66.
data(SahaData)
data(SahaData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Singh-Joarder model. The function can also return the transformed variable. The Singh-Joarder model was proposed by Singh and Joarder in 1997.
SinghJoarder(z,p,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
SinghJoarder(z,p,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive question |
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 basics of the Singh-Joarder scheme are similar to Warner's randomized response device, with the following difference. If a person labelled bears
he/she is told to say so if so guided by a card drawn from a box of
and
marked cards in proportions
and
.
However, if he/she bears
and is directed by the card to admit it, he/she is told to postpone the reporting based on the first draw of the card from
the box but to report on the basis of a second draw. Therefore,
The transformed variable is and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Singh-Joarder model. The transformed variable is also reported, if required.
Singh, S., Joarder, A.H. (1997). Unknown repeated trials in randomized response sampling. Journal of the Indian Statistical Association, 30, 109-122.
N=802 data(SinghJoarderData) dat=with(SinghJoarderData,data.frame(z,Pi)) p=0.6 cl=0.95 SinghJoarder(dat$z,p,dat$Pi,"mean",cl,N)
N=802 data(SinghJoarderData) dat=with(SinghJoarderData,data.frame(z,Pi)) p=0.6 cl=0.95 SinghJoarder(dat$z,p,dat$Pi,"mean",cl,N)
This data set contains observations from a randomized response survey conducted in a university to investigate compulsive spending.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Singh-Joarder model (Singh and Joarder, 1997) with parameter .
data(SinghJoarderData)
data(SinghJoarderData)
A data frame containing 170 observations from a population of students. The variables are:
ID: Survey ID of student respondent
z: The randomized response to the question: Do you have spend compulsively?
Pi: first-order inclusion probabilities
Singh, S., Joarder, A.H. (1997). Unknown repeated trials in randomized response sampling. Journal of the Indian Statistical Association, 30, 109-122.
data(SinghJoarderData)
data(SinghJoarderData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the SoberanisCruz model. The function can also return the transformed variable. The SoberanisCruz model was proposed by Soberanis Cruz et al. in 2008.
SoberanisCruz(z,p,alpha,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
SoberanisCruz(z,p,alpha,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive question |
alpha |
proportion of people with the innocuous attribute |
pi |
vector of the first-order inclusion probabilites |
type |
the estimator type: total or mean |
cl |
confidence leve |
N |
size of the population. By default it is NULL |
pij |
matrix of the second-order inclusion probabilities. By default it is NULL |
The SoberanisCruz model considers the introduction of an innocuous variable correlated with the sensitive variable. This variable does not affect individual sensitivity, and maintains reliability. The sampling procedure is the same as in the Horvitz model.
Point and confidence estimates of the sensitive characteristics using the SoberanisCruz model. The transformed variable is also reported, if required.
Soberanis Cruz, V., Ramírez Valverde, G., Pérez Elizalde, S., González Cossio, F. (2008). Muestreo de respuestas aleatorizadas en poblaciones finitas: Un enfoque unificador. Agrociencia Vol. 42 Núm. 5 537-549.
data(SoberanisCruzData) dat=with(SoberanisCruzData,data.frame(z,Pi)) p=0.7 alpha=0.5 cl=0.90 SoberanisCruz(dat$z,p,alpha,dat$Pi,"total",cl)
data(SoberanisCruzData) dat=with(SoberanisCruzData,data.frame(z,Pi)) p=0.7 alpha=0.5 cl=0.90 SoberanisCruz(dat$z,p,alpha,dat$Pi,"total",cl)
This data set contains observations from a randomized response survey conducted in a population of 1500 families in a Spanish town
to investigate speeding.
The sample is drawn by cluster sampling by district.
The randomized response technique used is the SoberanisCruz model (Soberanis Cruz et al., 2008) with parameter .
The innocuous question is: Is your car medium/high quality? with
.
data(SoberanisCruzData)
data(SoberanisCruzData)
A data frame containing 290 observations from a population of families divided into twenty cluster.
The variables are:
ID: Survey ID
CL: Cluster ID
z: The randomized response to the question: Do you often break the speed limit?
Pi: first-order inclusion probabilities
Soberanis Cruz, V., Ramírez Valverde, G., Pérez Elizalde, S., González Cossio, F. (2008). Muestreo de respuestas aleatorizadas en poblaciones finitas: Un enfoque unificador. Agrociencia Vol. 42 Núm. 5 537-549.
data(SoberanisCruzData)
data(SoberanisCruzData)
Computes the randomized response estimation, its variance estimation and its confidence interval through the Warner model. The function can also return the transformed variable. The Warner model was proposed by Warner in 1965.
Warner(z,p,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
Warner(z,p,pi,type=c("total","mean"),cl,N=NULL,pij=NULL)
z |
vector of the observed variable; its length is equal to |
p |
proportion of marked cards with the sensitive attribute |
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 |
Warner's randomized response device works as follows. A sampled person labelled is offered a box of a considerable number of identical cards with a proportion
of them marked
and the rest marked
. The person is requested, randomly, to draw one of them, to observe the mark on the card,
and to give the response
The randomized response is given by and the estimated variance is
.
Point and confidence estimates of the sensitive characteristics using the Warner model. The transformed variable is also reported, if required.
Warner, S.L. (1965). Randomized Response: a survey technique for eliminating evasive answer bias. Journal of the American Statistical Association 60, 63-69.
N=802 data(WarnerData) dat=with(WarnerData,data.frame(z,Pi)) p=0.7 cl=0.95 Warner(dat$z,p,dat$Pi,"total",cl)
N=802 data(WarnerData) dat=with(WarnerData,data.frame(z,Pi)) p=0.7 cl=0.95 Warner(dat$z,p,dat$Pi,"total",cl)
This data set contains observations from a randomized response survey related to alcohol abuse.
The sample is drawn by simple random sampling without replacement.
The randomized response technique used is the Warner model (Warner, 1965) with parameter .
data(WarnerData)
data(WarnerData)
A data frame containing 125 observations from a population of students. The variables are:
ID: Survey ID of student respondent
z: The randomized response to the question: During the last month, did you ever have more than five drinks (beer/wine) in succession?
Pi: first-order inclusion probabilities
Warner, S.L. (1965). Randomized Response: a survey technique for eliminating evasive answer bias. Journal of the American Statistical Association 60, 63-69.
data(WarnerData)
data(WarnerData)