Skip to contents

Each respondent answers truthfully with probability \(p = e^\epsilon/(1+e^\epsilon)\) and flips otherwise. This is LOCAL differential privacy: there is no trusted curator, and the raw data never leaves the respondent.

Usage

morie_randomized_response_dp(truth, epsilon = 1, seed = NULL)

Arguments

truth

binary vector of true responses (0/1).

epsilon

privacy budget.

seed

optional integer seed.

Value

list with responses, p_truth, raw_proportion, estimate (debiased), se.

Details

The raw proportion of 1s is biased toward 1/2 by construction. Use estimate, which inverts the flip; reporting the raw proportion is the standard misreading and understates any real effect.

References

Warner, S. L. (1965). Randomized response: a survey technique for eliminating evasive answer bias. JASA, 60(309), 63-69.

Examples

set.seed(1)
r <- morie_randomized_response_dp(rbinom(2000, 1, 0.3), epsilon = 2)
round(r$estimate, 2)
#> [1] 0.31