Description Usage Arguments Details Value Slots References Examples
A wrapper function that makes repeated calls to listExperiment
to calculate parameter estimates and standard errors through non-parametric boot-strapping.
1 2 3 4 5 6 7 8 9 10 11 | bootListExperiment(formula, data, treatment, J, direct = NULL,
sensitive.response = NULL, outcome = NULL, outcome.trials = NULL,
outcome.model = "logistic", outcome.constrained = TRUE,
control.constraint = "partial", misreport.treatment = TRUE,
weights = NULL, se = TRUE, tolerance = 1e-08, max.iter = 5000,
n.runs = 1, verbose = TRUE, get.data = FALSE, par.control = NULL,
par.sensitive = NULL, par.misreport = NULL, par.outcome = NULL,
par.outcome.aux = NULL, formula.control = NULL,
formula.sensitive = NULL, formula.misreport = NULL,
formula.outcome = NULL, boot.iter = 1000, parallel = FALSE,
n.cores = 2, cluster = NULL)
|
formula |
An object of class " |
data |
A data frame containing the variables to be used in the model. |
treatment |
A string indicating the name of the treatment indicator in the data. This variable must be coded as a binary, where 1 indicates assignment to treatment and 0 indicates assignment to control. |
J |
An integer indicating the number of control items in the list experiment. |
direct |
A string indicating the name of the direct question response in the data. The direct question must be coded as a binary variable. If NULL (default), a misreport sub-model is not fit. |
sensitive.response |
A value 0 or 1 indicating whether the response that is considered sensitive in the list experiment/direct question is 0 or 1. |
outcome |
A string indicating the variable name in the data to use as the outcome in an outcome sub-model. If NULL (default), no outcome sub-model is fit. [experimental] |
outcome.trials |
An integer indicating the number of trials in a binomial/betabinomial model if both an outcome sub-model is used and if the argument |
outcome.model |
A string indicating the model type to fit for the outcome sub-model ("logistic", "binomial", "betabinomial"). [experimental] |
outcome.constrained |
A logical value indicating whether to constrain U* = 0 in the outcome sub-model. Defaults to TRUE. [experimental] |
control.constraint |
A string indicating the constraint to place on Z* and U* in the control-items sub-model:
|
misreport.treatment |
A logical value indicating whether to include a parameter for the treatment indicator in the misreport sub-model. Defaults to TRUE. |
weights |
A string indicating the variable name of survey weights in the data (note: standard errors are not currently output when survey weights are used). |
se |
A logical value indicating whether to calculate standard errors. Defaults to TRUE. |
tolerance |
The desired accuracy for EM convergence. The EM loop breaks after the change in the log-likelihood is less than the value of |
max.iter |
The maximum number of iterations for the EM algorithm. Defaults to 10000. |
n.runs |
The total number of times that the EM algorithm is run (can potentially help avoid local maxima). Defaults to 1. |
verbose |
A logical value indicating whether to print information during model fitting. Defaults to TRUE. |
get.data |
For internal use. Used by wrapper function |
par.control |
A vector of starting parameters for the control-items sub-model. Must be in the order of the parameters in the resulting regression output. If NULL (default), randomly generated starting points are used, drawn from uniform(-2, 2). |
par.sensitive |
A vector of starting parameters for the sensitive-item sub-model. Must be in the order of the parameters in the resulting regression output. If NULL (default), randomly generated starting points are used, drawn from uniform(-2, 2). |
par.misreport |
A vector of starting parameters for the misreport sub-model. Must be in the order of the parameters in the resulting regression output. If NULL (default), randomly generated starting points are used, drawn from uniform(-2, 2). |
par.outcome |
A vector of starting parameters for the outcome sub-model. Must be in the order of the parameters in the resulting regression output. If NULL (default), randomly generated starting points are used, drawn from uniform(-2, 2). [experimental] |
par.outcome.aux |
A vector of starting parameters for the outcome sub-model in which |
formula.control |
An object of class " |
formula.sensitive |
An object of class " |
formula.misreport |
An object of class " |
formula.outcome |
An object of class " |
boot.iter |
The number of boot strap samples to generate. |
parallel |
A logical value indicating whether to run bootstraping in parallel on a multi-core computer. |
n.cores |
The number of cores/threads on which to generate bootstrap samples (when |
cluster |
An optional cluster object using makeCluster() from the |
bootListExperiment
is a wrapper for the function
listExperiment
that allows researchers to fit a bootstrapped
model. The arguments for this function include those for the
listExperiment
function, in addition to a small number
of arguments specific to the bootstrap.
listExperiment
returns an object of class "listExperiment".
A summary of this object is given using the summary.listExperiment
function. All components in the "listExperiment" class are listed below.
par.control
A named vector of coefficients from the control-items sub-model.
par.sensitive
A named vector of coefficients from the sensitive-item sub-model.
par.misreport
A named vector of coefficients from the misreport sub-model.
par.outcome
A named vector of coefficients from the outcome sub-model.
par.outcome.aux
A named vector of (auxiliary) coefficients from the outcome sub-model (if outcome.model
= "betabinomial").
df
Degrees of freedom.
se.sensitive
Standard errors for parameters in the sensitive-item sub-model.
se.control
Standard errors for parameters in the control-items sub-model.
se.misreport
Standard errors for parameters in the misreport sub-model.
se.outcome
Standard errors for parameters in the outcome sub-model.
se.outcome.aux
Standard errors for the auxiliary parameters in the outcome sub-model (if outcome.model
= "betabinomial").
vcov.mle
Variance-covariance matrix.
w
The matrix of posterior predicted probabilities for each observation in the data used for model fitting.
data
The data frame used for model fitting.
direct
The string indicating the variable name of the direct question.
treatment
The string indicating the variable name of the treatment indicator.
model.misreport
A logical value indicating whether a misreport sub-model was fit.
outcome.model
The type of model used as the outcome sub-model.
outcome.constrained
A logical value indicating whether the parameter U* was constrained to 0 in the outcome sub-model.
control.constraint
A string indicating the constraints placed on the parameters Z* and U* in the control-items sub-model.
misreport.treatment
A logical value indicating whether a treatment indicator was included in the misreport sub-model.
weights
A string indicating the variable name of the survey weights.
formula
The model formula.
formula.control
The model specification of the control-items sub-model.
formula.sensitive
The model specification of the sensitive-item sub-model.
formula.misreport
The model specification of the misreport sub-model.
formula.outcome
The model specification of the outcome sub-model.
sensitive.response
The value 0 or 1 indicating the response to the list experiment/direct question that is considered sensitive.
xlevels
The factor levels of the variables used in the model.
llik
The model log-likelihood.
n
The sample size of the data used for model fitting (this value excludes rows removed through listwise deletion).
J
The number of control items in the list experiment.
se
A logical value indicating whether standard errors were calculated.
runs
The parameter estimates from each run of the EM algorithm (note: the parameters that result in the highest log-likelihood are used as the model solution).
call
The method call.
boot
A logical value indicating whether non-parametric bootstrapping was used to calculate model parameters and standard errors.
Eady, Gregory. 2017 "The Statistical Analysis of Misreporting on Sensitive Survey Questions."
Imai, Kosuke. 2011. "Multivariate Regression Analysis for the Item Count Technique." Journal of the American Statistical Association 106 (494): 407-416.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | ## Simulated list experiment and direct question
n <- 10000
J <- 4
# Covariates
x <- cbind(intercept = rep(1, n), continuous1 = rnorm(n),
continuous2 = rnorm(n), binary1 = rbinom(n, 1, 0.5))
treatment <- rbinom(n, 1, 0.5)
# Simulate Z*
param_sensitive <- c(0.25, -0.25, 0.5, 0.25)
prob_sensitive <- plogis(x %*% param_sensitive)
true_belief <- rbinom(n, 1, prob = prob_sensitive)
# Simulate whether respondent misreports (U*)
param_misreport <- c(-0.25, 0.25, -0.5, 0.5)
prob_misreport <- plogis(x %*% param_misreport) * true_belief
misreport <- rbinom(n, 1, prob = prob_misreport)
# Simulate control items Y*
param_control <- c(0.25, 0.25, -0.25, 0.25, U = -0.5, Z = 0.25)
prob.control <- plogis(cbind(x, misreport, true_belief) %*% param_control)
control_items <- rbinom(n, J, prob.control)
# List experiment and direct question responses
direct <- true_belief
direct[misreport == 1] <- 0
y <- control_items + true_belief * treatment
A <- data.frame(y, direct, treatment,
continuous1 = x[, "continuous1"],
continuous2 = x[, "continuous2"],
binary1 = x[, "binary1"])
## Not run:
# Note: substantial computation time
model.sim <- bootListExperiment(y ~ continuous1 + continuous2 + binary1,
data = A, treatment = "treatment",
direct = "direct",
J = 4, control.constraint = "none",
sensitive.response = 1,
boot.iter = 500, parallel = TRUE, n.cores = 2)
summary(model.sim, digits = 3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.