Computes \(\Pr(\lambda_t / \lambda_c \le q)\) (or the upper tail \(\Pr(\lambda_t / \lambda_c > q)\)) for hazards with independent Gamma distributions, \(\lambda_t \sim \textrm{Gamma}(a_t, b_t)\) and \(\lambda_c \sim \textrm{Gamma}(a_c, b_c)\) (shape and rate). This is the posterior probability used for a time-to-event endpoint evaluated by the hazard ratio with a concurrent, external or hypothetical control.
Arguments
- q
Numeric vector of quantiles (hazard ratios).
- shape_t, rate_t
Positive shape and rate of the treatment hazard.
- shape_c, rate_c
Positive shape and rate of the control hazard.
- lower.tail
Logical; if
TRUE(default), probabilities are \(\Pr(\lambda_t / \lambda_c \le q)\), otherwise \(\Pr(\lambda_t / \lambda_c > q)\).
Value
A numeric vector of probabilities. All arguments except
lower.tail are recycled to a common length; each must have length
1 or the common length.
Details
Because \(2 b_k \lambda_k\) has the chi-squared distribution with
\(2 a_k\) degrees of freedom, \((b_t \lambda_t / a_t) /
(b_c \lambda_c / a_c)\) has the F distribution with \(2 a_t\) and
\(2 a_c\) degrees of freedom, and
$$\Pr(\lambda_t / \lambda_c \le q) =
F_{2 a_t, 2 a_c}\left(\frac{q \, a_c \, b_t}{a_t \, b_c}\right),$$
which is computed exactly by pf.
See also
Other distributions:
cellprob_binary2(),
pbetabinomdiff(),
pbetadiff(),
psurvdiff(),
ptdiff(),
rdirichlet()
