data(nigeria)
## Define design parameters
# \donttest{
set.seed(44)
p <- 2/3 # probability of answering honestly in Forced Response Design
p1 <- 1/6 # probability of forced 'yes'
p0 <- 1/6 # probability of forced 'no'
## Fit joint model of responses to an outcome regression of joining a civic
## group and the randomized response item of having a militant social connection
rr.q1.pred.obj <-
rrreg.predictor(civic ~ cov.asset.index + cov.married + I(cov.age/10) +
I((cov.age/10)^2) + cov.education + cov.female
+ rr.q1, rr.item = "rr.q1", parstart = FALSE, estconv = TRUE,
data = nigeria, verbose = FALSE, optim = TRUE,
p = p, p1 = p1, p0 = p0, design = "forced-known")
## Generate predicted probabilities for the likelihood of joining
## a civic group across respondents using quasi-Bayesian simulations.
rr.q1.rrreg.predictor.pred <- predict(rr.q1.pred.obj,
avg = TRUE, quasi.bayes = TRUE,
n.sims = 1000)
# }
Run the code above in your browser using DataLab