My data was collected using Randomized Response Technique. So I have additional variability into the data. I have a binary response variable. Should I customize a logit link function to incorporate the known probabilities of Randomized Response Technique to perform a logistic regression? I would like to know if this approach is appropriate or how one might correctly perform a regression with these kinds of responses.

If a customized link function is appropriate, I should customize the logit $\log \left({p \over 1-p}\right)$ to the customized $\log \left({p-0.25 \over 0.75-p}\right)$. Can anyone help me to do that? I don't have too much experience using R.

  • 1
    $\begingroup$ Although we could migrate this to SO where the R community likely could give you a good answer to the programming issue quickly, I would like to suggest instead that you edit your question to ask whether this approach is appropriate and how one might correctly perform a regression with these kinds of responses. $\endgroup$
    – whuber
    Sep 1, 2014 at 15:57
  • $\begingroup$ the only way I know is creating a custom set of functions to get a family through make.link, and then calling it from the glm. You need to define the function itself, the inverse, and the derivative I think.. Check make.link?, family? in help and at google $\endgroup$
    – D.Castro
    Sep 1, 2014 at 18:39

1 Answer 1


Here is how to do the necessary algebra. Others can add an example of how to do it in R. Suppose you response variable of interest is $Y$, which is the response to a question with answer "yes" or "no" (We code "yes" as 1 and "no" as 0). Suppose we have a valid logistic regression model for $Y$: $$ P(Y=\text{yes} | x) = g^{-1}(x) =\frac{e^{\beta' x}}{1+e^{\beta' x}} $$ where $g$ is the link function, $g^{-1}$ the mean function. We get $$ g(y) = \ln(\frac{y}{1-y}) $$ No, with the randomized resaponse technique, instead you observe a response variable $Y^*$ which is defined as $Y^* = \begin{cases} Y, ~~\text{with probability $1-q$} \\ \text{yes}, ~~\text{with probability $q$}. \end{cases}$
Since now, in all cases, regardless of the values of the regressor variable(s) $x$, the probability of a "yes" response is at least $q$, so effectively we obtain the link function by restricting the probability parameter to range in $(q,1)$, not in $(0,1)$. Calculate: $$ P(Y^*=\text{yes}|x)=q+(1-q)P(Y=\text{yes}|x)=\frac{q+e^{\beta'x}}{1+e^{\beta'x}} $$ (where $q$ here is a known probability). Inverting this gives the link function $g(y)=\ln(\frac{y-q}{1-y})$.

  • $\begingroup$ Using RRT, I have 0.25 probability of the answer being a ‘forced yes’ and 0.5 probability of having to answer the sensitive question truthfully. HOw I incorporate these probabilities in the link function? $\endgroup$
    – Lu_cc
    Sep 3, 2014 at 14:00
  • $\begingroup$ Why do your two probabilities not sum to one? (0.25+0.5=0.75<1) Where did the missing 0.25 probability go? $\endgroup$ Sep 3, 2014 at 15:15
  • $\begingroup$ Anyhow, did you understand the roloe of the parameter $q$ in my answer? $\endgroup$ Sep 9, 2014 at 11:12
  • $\begingroup$ Thanks for your contribution. I already solve my problem! $\endgroup$
    – Lu_cc
    Oct 2, 2014 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.