Skip to contents

[Experimental]

Compute the posterior probability to be above threshold assuming a beta prior on the response rate such that the response rate in the experimental or treatment E exceeds the threshold set to compute the posterior probability p : Pr(P_E > p | data). Prior is P_E ~ beta(a, b), with default set to be a uniform or beta(1,1).

We observed x successes in n trials and so the posterior is P_E | data ~ beta(a + x, b + n - x).

Usage

postprobBeta(x, n, p, a = 1, b = 1)

Arguments

x

(numeric):
number of successes.

n

(number):
number of patients.

p

(number):
threshold set to compute posterior probability.

a

(matrix):
first parameter alpha of the beta prior (successes).

b

(matrix):
second parameter beta of the beta prior (failures).

Value

The posterior probability that the response rate P_E is above a threshold p.

Examples

# Example taken from Lee & Liu (2006)
# We observed 16 successes out of 23 patients # should we write this in the documentation
# We set a threshold of 0.60
# Assume a beta(0.6,0.4) prior for P_E
# Posterior will be a beta(16.6,22.8), Pr(P_E > p | data) = 0.8358808


# Example taken from Lee and Liu (2006)
postprobBeta(x = 16, n = 23, p = 0.60, a = 0.6, b = 0.4)
#> [1] 0.8359808
# Interpretation :
# The probability 16 of 23 successes is greater than 60 % threshold is approximately 84 %