Learn R Programming

RRreg (version 0.2.0)

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 = c(10, 100),
  fit.bound = 10, maxit = 1000, start = NULL, ...)

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 vignette("RRreg") for details.
p
randomization probability/probabilities (depending on model)
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
Minimum and maximum number of fitting replications using random starting values to avoid local maxima (only if start=NULL)
fit.bound
The model is fitted repeatedly either until the absolute parameter estimates are below fit.bound or the maximum number of fitting replication is reached. Thereby, stability of the estimates is increased. fit.bound should be incre
maxit
Maximum number of iterations within each run of optim
start
starting values for optimization. Might be useful if model does not converge with default starting values.
...
ignored

Value

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

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 = c(1,5))
summary(ana)

Run the code above in your browser using DataLab