RRlog | R Documentation |
A dichotomous variable, measured once or more per person by a randomized response method, serves as dependent variable using one or more continuous and/or categorical predictors.
RRlog( formula, data, model, p, group, n.response = 1, LR.test = TRUE, fit.n = 3, EM.max = 1000, optim.max = 500, ... )
formula |
specifying the regression model, see |
data |
|
model |
Available RR models: |
p |
randomization probability/probabilities (depending on model, see
|
group |
vector specifying group membership. Can be omitted for
single-group RR designs (e.g., Warner). For two-group RR designs (e.g.,
|
n.response |
number of responses per participant, e.g., if a participant
responds to 5 RR questions with the same randomization probability |
LR.test |
test regression coefficients by a likelihood ratio test, i.e.,
fitting the model repeatedly while excluding one parameter at a time (each
nested model is fitted only once, which can result in local maxima). The
likelihood-ratio test statistic G^2(df=1) is reported in the table of
coefficiencts as |
fit.n |
Number of fitting replications using random starting values to avoid local maxima |
EM.max |
maximum number of iterations of the EM algorithm. If
|
optim.max |
Maximum number of iterations within each run of |
... |
ignored |
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
.
Returns an object RRlog
which can be analysed by the generic
method summary
. In the table of coefficients, the column
Wald
refers to the Chi^2 test statistic which is computed as Chi^2 =
z^2 = Estimate^2/StdErr^2. If LR.test = TRUE
, the test statistic
deltaG2
is the likelihood-ratio-test statistic, which is computed by
fitting a nested logistic model without the corresponding predictor.
Daniel W. Heck
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.
anova.RRlog
for model comparisons, plot.RRlog
for plotting predicted regression curves, and vignette('RRreg')
or
https://www.dwheck.de/vignettes/RRreg.html for a
detailed description of the RR models and the appropriate definition of
p
# generate data set without biases dat <- RRgen(1000, pi = .3, "Warner", p = .9) dat$covariate <- rnorm(1000) dat$covariate[dat$true == 1] <- rnorm(sum(dat$true == 1), .4, 1) # analyse ana <- RRlog(response ~ covariate, dat, "Warner", p = .9, fit.n = 1) summary(ana) # check with true, latent states: glm(true ~ covariate, dat, family = binomial(link = "logit"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.