Skip to contents

Bundle this function with stats::uniroot(), one can find the cutting rules(total observation time) for Go/Nogo decision

Usage

Find_T(x, shape, prior_rate, cut, lower.tail, prob_target)

Arguments

x

numeric vector, total observation time

shape

posterior shape of the gamma distribution for hazard

prior_rate

prior rate of the rate parameter of the gamma distribution for hazard.

The posterior rate is prior_rate + x

cut

cutting ponit of the hazard(lambda) for different criteria

lower.tail

whether to return the lower tail of the probability distribution.

For efficacy criteria, this should be TRUE, otherwise FALSE

prob_target

target probability of the corresponding criteria

Declare Go if post_prob(lambda <= cut| data) >= prob_target

Declare Nogo if post_prob(lambda > cut | data) >= prob_target

Value

The probability difference between the computed posterior probability and the target probability, i.e. post_prob - prob_target