Learn R Programming

RRreg (version 0.4.1)

RRlog: Logistic randomized response regression

Description

A dichotomous variable, measured by a randomized response method, serves as dependent variable using one or more continuous and/or categorical predictors

Usage

RRlog(formula, data, model, p, group, LR.test = TRUE, fit.n = 3,
  EM.max = 1000, optim.max = 500, ...)

Arguments

formula
specifying the regression model, see formula
data
data.frame, in which variables can be found (optional)
model
Available RR models: "Warner", "UQTknown", "UQTunknown", "Mangat", "Kuk", "FR", "Crosswise", "CDM", "CDMsym", "SLD". See
p
randomization probability/probabilities (depending on model, see RRuni for details)
group
vector specifying group membership. Can be omitted for single-group RR designs (e.g., Warner). For two-group RR designs (e.g., CDM or SLD), use 1 and 2 to indicate the group membership, matching the respective randomization proba
LR.test
test regression coefficients by a likelihood ratio test, i.e., fitting the model repeatedly while excluding one parameter at a time
fit.n
Number of fitting replications using random starting values to avoid local maxima param fit.bound The model is fitted repeatedly either until the absolute parameter estimates are below fit.bound or the maximum number of fitting replication i
EM.max
maximum number of iterations of the EM algorithm. If EM.max=0, the EM algorithm is skipped.
optim.max
Maximum number of iterations within each run of optim
...
ignored

Value

  • Returns an object RRlog which can be analysed by the generic method summary

Details

The logistic regression model is fitted first by an EM algorithm, in which the dependend RR variable is treated as a misclassified binary variable (Magder & Hughes, 1997). The results are used as starting values for a Newton-Raphson based optimization by optim.

References

van den Hout, A., van der Heijden, P. G., & Gilchrist, R. (2007). The logistic regression model with response variables subject to randomized response. Computational Statistics & Data Analysis, 51, 6060-6069.

See Also

vignette('RRreg') or https://dl.dropboxusercontent.com/u/21456540/RRreg/index.html for a detailed description of the RR models and the appropriate definition of p

Examples

Run this code
# generate data set without biases
dat <- RRgen(1000,pi=.3,"Warner",p=.8)
dat$covariate <- rnorm(1000)
dat$covariate[dat$true==1] <- rnorm(sum(dat$true==1),.4,1)
# analyse
ana <- RRlog(response~covariate,dat,"Warner",.8, fit.n = 1)
summary(ana)

Run the code above in your browser using DataLab