post_summary_bin_2arm: Posterior Summary for Two-Arm Comparative Trial with Binary...

View source: R/post_summary_bin_2arm.R

post_summary_bin_2armR Documentation

Posterior Summary for Two-Arm Comparative Trial with Binary Endpoint

Description

The post_summary_bin_2arm function is designed to compute the posterior summary for the treatment effect in a two-arm comparative trial with a binary endpoint under one of three borrowing strategies: self-adapting mixture prior (SAM), robust MAP prior with fixed weight (rMAP), or non-informative prior (NP).

Usage

post_summary_bin_2arm(
  x.t,
  x,
  if.prior,
  nf.prior,
  prior.t = nf.prior,
  n.t,
  n,
  delta,
  cutoff,
  method = c("SAM", "rMAP", "NP"),
  alternative = c("greater", "less"),
  margin = 0,
  weight_rMAP = 0.5,
  method.w = "LRT",
  prior.odds = 1,
  rel.tol = 1e-08
)

Arguments

x.t

Observed number of responses in the treatment arm.

x

Observed number of responses in the control arm.

if.prior

Informative prior constructed based on historical data for the control arm, represented (approximately) as a beta mixture prior.

nf.prior

Non-informative prior used as the robustifying component for the control arm prior.

prior.t

Prior used for the treatment arm. If missing, the default value is set to be nf.prior.

n.t

Sample size for the treatment arm.

n

Sample size for the control arm.

delta

Clinically significant difference used for the SAM prior. This argument is only used when method = "SAM".

cutoff

Posterior probability cutoff used for decision making. The null hypothesis is rejected if the posterior tail probability exceeds cutoff.

method

Borrowing strategy for the control arm. Must be one of "SAM", "rMAP", or "NP".

alternative

Direction of the posterior decision. Must be one of "greater" (for superiority) or "less" (for inferiority).

margin

Clinical margin. Must be a non-negative scalar. The default value is 0.

weight_rMAP

Weight assigned to the informative prior component (0 \leq weight_rMAP \leq 1) for the robust MAP prior. This argument is only used when method = "rMAP". The default value is 0.5.

method.w

Methods used to determine the mixture weight for SAM priors. The default method is "LRT" (Likelihood Ratio Test), the alternative option is "PPR" (Posterior Probability Ratio). See SAM_weight for more details.

prior.odds

The prior probability of H_0 being true compared to the prior probability of H_1 being true using PPR method. The default value is 1. See SAM_weight for more details.

rel.tol

Relative tolerance for numerical integration used to evaluate the posterior probability.

Details

The treatment effect is defined as \tau = \theta_t - \theta, where \theta_t and \theta denote the response rates in the treatment and control arms, respectively. Inference is based on the posterior distribution of \tau given the observed response counts from the two arms.

The posterior for the treatment arm is obtained by updating prior.t using the observed response count x.t. The posterior for the control arm depends on the selected borrowing strategy:

  • SAM: the prior for the control arm is a mixture of if.prior and nf.prior, with adaptive mixture weight determined by the SAM borrowing rule.

  • rMAP: the prior for the control arm is a fixed mixture of if.prior and nf.prior, with fixed weight weight_rMAP.

  • NP: the prior for control arm is nf.prior.

When alternative = "greater", inference is based on P(\theta_t - \theta > margin \mid X_t, X). When alternative = "less", inference is based on P(\theta_t - \theta < -margin \mid X_t, X).

The posterior mean and posterior variance of \tau are defined as

E(\tau \mid X_t, X) = E(\theta_t \mid X_t) - E(\theta \mid X),

and

\mathrm{Var}(\tau \mid X_t, X) = \mathrm{Var}(\theta_t \mid X_t) + \mathrm{Var}(\theta \mid X),

where independence between the treatment and control arm posteriors is assumed conditional on the current and historical data.

Value

A list containing the posterior probability in the requested direction, posterior mean and variance of \tau, decision indicator, borrowing weight used for the control arm prior, and the corresponding trial data and method information.

See Also

SAM_weight, SAM_prior


SAMprior documentation built on April 28, 2026, 1:07 a.m.