post_summary_cont_2arm: Posterior Summary for Two-Arm Comparative Trial with...

View source: R/post_summary_cont_2arm.R

post_summary_cont_2armR Documentation

Posterior Summary for Two-Arm Comparative Trial with Continuous Endpoint

Description

The post_summary_cont_2arm function is designed to compute the posterior summary for the treatment effect in a two-arm comparative trial with a continuous 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_cont_2arm(
  ybar_t,
  ybar,
  if.prior,
  nf.prior,
  prior.t = nf.prior,
  n.t,
  n,
  sigma.t,
  sigma,
  delta,
  cutoff,
  method = c("SAM", "rMAP", "NP"),
  alternative = c("greater", "less"),
  margin = 0,
  weight_rMAP = 0.5,
  method.w = "LRT",
  prior.odds = 1
)

Arguments

ybar_t

Observed sample mean in the treatment arm.

ybar

Observed sample mean in the control arm.

if.prior

Informative prior constructed based on historical data for the control arm, represented (approximately) as a normal 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.

sigma.t

Known standard deviation in the treatment arm.

sigma

Known standard deviation in 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.

Details

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

The posterior for the treatment arm is obtained by updating prior.t using the observed sample mean ybar_t. The posterior for the control arm depends on the selected borrowing strategy:

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

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

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

When alternative = "greater", inference is based on P(\theta_t - \theta > margin \mid \bar{Y}_t, \bar{Y}). When alternative = "less", inference is based on P(\theta_t - \theta < -margin \mid \bar{Y}_t, \bar{Y}).

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

E(\tau \mid \bar{Y}_t, \bar{Y}) = E(\theta_t \mid \bar{Y}_t) - E(\theta \mid \bar{Y}),

and

\mathrm{Var}(\tau \mid \bar{Y}_t, \bar{Y}) = \mathrm{Var}(\theta_t \mid \bar{Y}_t) + \mathrm{Var}(\theta \mid \bar{Y}),

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.