
Posterior probability P(p2 > p1 | data) under independent Beta priors
Source:R/bayes_factors.R
postProbHplus.RdUses Beta posteriors induced by the analysis priors to compute \(P(p_2 > p_1 \mid y_1, y_2)\).
Arguments
- y1
Number of successes in arm 1 (control).
- y2
Number of successes in arm 2 (treatment).
- n1
Sample size in arm 1.
- n2
Sample size in arm 2.
- a_1_a, b_1_a
Shape parameters of the Beta prior for \(p_1\) under the alternative (analysis prior).
- a_2_a, b_2_a
Shape parameters of the Beta prior for \(p_2\) under the alternative (analysis prior).