RRglm {GLMMRR} | R Documentation |
Fitting Generalized Linear Models with binary Randomized Response data
Description
Fit a generalized linear model (GLM) with binary Randomized Response data.
Implemented as a wrapper for glm
. Reference: Fox, J-P, Veen, D. and Klotzke, K. (2018).
Generalized Linear Mixed Models for Randomized Responses. Methodology. https://doi.org/10.1027/1614-2241/a000153
Usage
RRglm(formula, link, item, RRmodel, p1, p2, data, na.action = "na.omit", ...)
Arguments
formula |
a two-sided linear formula object describing the model to be fitted, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. |
link |
a glm link function for binary outcomes. Must be a function name. Available options: "RRlink.logit", "RRlink.probit", "RRlink.cloglog" and "RRlink.cauchit" |
item |
optional item identifier for long-format data. |
RRmodel |
the Randomized Response model, defined per case. Available options: "DQ", "Warner", "Forced", "UQM", "Crosswise", "Triangular" and "Kuk" |
p1 |
the Randomized Response parameter p1, defined per case. Must be 0 <= p1 <= 1. |
p2 |
the Randomized Response parameter p2, defined per case. Must be 0 <= p2 <= 1. |
data |
a data frame containing the variables named in |
na.action |
a function that indicates what should happen when the data contain NAs.
The default action ( |
... |
other potential arguments to be passed to |
Value
An object of class RRglm. Extends the class glm
with Randomize Response data.
See Also
Examples
# Fit the model with fixed effects for gender, RR, pp and age using the logit link function.
# The Randomized Response parameters p1, p2 and model
# are specified for each observation in the dataset.
out <- RRglm(response ~ Gender + RR + pp + age, link="RRlink.logit", RRmodel=RRmodel,
p1=RRp1, p2=RRp2, data=Plagiarism, etastart=rep(0.01, nrow(Plagiarism)))
summary(out)