`power.rr.test`

is used to conduct power analysis for randomized
response survey designs.

power.rr.test(p, p0, p1, q, design, n = NULL, r, presp, presp.null = NULL, sig.level, prespT, prespC, prespT.null = NULL, prespC.null, power = NULL, type = c("one.sample", "two.sample"), alternative = c("one.sided", "two.sided"), solve.tolerance = .Machine$double.eps)

p | The probability of receiving the sensitive question (Mirrored Question Design, Unrelated Question Design); the probability of answering truthfully (Forced Response Design); the probability of selecting a red card from the 'yes' stack (Disguised Response Design). |
---|---|

p0 | The probability of forced 'no' (Forced Response Design). |

p1 | The probability of forced 'yes' (Forced Response Design). |

q | The probability of answering 'yes' to the unrelated question, which is assumed to be independent of covariates (Unrelated Question Design). |

design | Call of design (including modified designs) used: "forced-known", "mirrored", "disguised", "unrelated-known", "forced-unknown", and "unrelated-unknown". |

n | Number of observations. Exactly one of 'n' or 'power' must be NULL. |

r | For the modified designs only (i.e. "forced-unknown" for Forced
Response with Unknown Probability and "unrelated-unknown" for Unrelated
Question with Unknown Probability), |

presp | For a one sample test, the probability of possessing the sensitive trait under the alternative hypothesis. |

presp.null | For a one sample test, the probability of possessing the
sensitive trait under the null hypothesis. The default is |

sig.level | Significance level (Type I error probability). |

prespT | For a two sample test, the probability of the treated group possessing the sensitive trait under the alternative hypothesis. |

prespC | For a two sample test, the probability of the control group possessing the sensitive trait under the alternative hypothesis. |

prespT.null | For a two sample test, the probability of the treated
group possessing the sensitive trait under the null hypothesis. The default
is |

prespC.null | For a two sample test, the probability of the control group possessing the sensitive trait under the null hypothesis. |

power | Power of test (Type II error probability). Exactly one of 'n' or 'power' must be NULL. |

type | One or two sample test. For a two sample test, the alternative and null hypotheses refer to the difference between the two samples of the probabilities of possessing the sensitive trait. |

alternative | One or two sided test. |

solve.tolerance | When standard errors are calculated, this option specifies the tolerance of the matrix inversion operation solve. |

`power.rr.test`

contains the following components (the
inclusion of some components such as the design parameters are dependent
upon the design used):

Point estimates for the effects of covariates on the randomized response item.

Standard errors for estimates of the effects of covariates on the randomized response item.

For a one sample test, the probability of possessing the sensitive trait under the alternative hypothesis. For a two sample test, the difference between the probabilities of possessing the sensitive trait for the treated and control groups under the alternative hypothesis.

For a one sample test, the probability of possessing the sensitive trait under the null hypothesis. For a two sample test, the difference between the probabilities of possessing the sensitive trait for the treated and control groups under the null hypothesis.

Significance level (Type I error probability).

Power of test (Type II error probability).

One or two sample test.

One or two sided test.

This function allows users to conduct power analysis for randomized response survey designs, both for the standard designs ("forced-known", "mirrored", "disguised", "unrelated-known") and modified designs ("forced-unknown", and "unrelated -unknown").

Blair, Graeme, Kosuke Imai and Yang-Yang Zhou. (2015) "Design
and Analysis of the Randomized Response Technique." *Journal of the
American Statistical Association.*
Available at http://graemeblair.com/papers/randresp.pdf.

## Calculate the power to detect a sensitive item proportion of .2 ## with the forced design with known probabilities of 2/3 in truth-telling group, ## 1/6 forced to say "yes" and 1/6 forced to say "no" and sample size of 200. power.rr.test(p = 2/3, p1 = 1/6, p0 = 1/6, n = 200, presp = .2, presp.null = 0, design = "forced-known", sig.level = .01, type = "one.sample", alternative = "one.sided")#> $design #> [1] "forced-known" #> #> $n #> [1] 200 #> #> $r #> NULL #> #> $presp #> [1] 0.2 #> #> $presp.null #> [1] 0 #> #> $sig.level #> [1] 0.01 #> #> $power #> [1] 0.9868872 #> #> $type #> [1] "one.sample" #> #> $alternative #> [1] "one.sided" #># NOT RUN { ## Find power varying the number of respondents from 250 to 2500 and ## the population proportion of respondents possessing the sensitive ## trait from 0 to .15 presp.seq <- seq(from = 0, to = .15, by = .0025) n.seq <- c(250, 500, 1000, 2000, 2500) power <- list() for(n in n.seq) { power[[n]] <- rep(NA, length(presp.seq)) for(i in 1:length(presp.seq)) power[[n]][i] <- power.rr.test(p = 2/3, p1 = 1/6, p0 = 1/6, n = n, presp = presp.seq[i], presp.null = 0, design = "forced-known", sig.level = .01, type = "one.sample", alternative = "one.sided")$power } ## Replicates the results for Figure 2 in Blair, Imai, and Zhou (2014) # }