eval_scenario_bin_2arm: Evaluate One Scenario for a Two-Arm Comparative Trial with...

View source: R/eval_scenario_bin_2arm.R

eval_scenario_bin_2armR Documentation

Evaluate One Scenario for a Two-Arm Comparative Trial with Binary Endpoint

Description

The eval_scenario_bin_2arm function is designed to evaluate repeated-sampling operating characteristics for a two-arm comparative trial with a binary endpoint under one borrowing strategy: self-adapting mixture prior (SAM), robust MAP prior with fixed weight (rMAP), or non-informative prior (NP).

Usage

eval_scenario_bin_2arm(
  if.prior,
  nf.prior,
  prior.t = nf.prior,
  n.t,
  n,
  theta.t,
  theta,
  cutoff,
  delta,
  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

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

Number of subjects in the treatment arm.

n

Number of subjects in the control arm.

theta.t

True treatment arm response rate.

theta

True control arm response rate.

cutoff

Posterior probability cutoff used for decision making. Rejection occurs if the posterior probability exceeds cutoff.

delta

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

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 in posterior probability calculations.

Details

The treatment effect is defined as \tau = \theta_t - \theta, where \theta_t and \theta denote the true response rates in the treatment and control arms, respectively.

For a given true scenario (\theta_t, \theta), this function computes the repeated-sampling rejection probability, bias, root mean squared error (RMSE), and mean borrowing weight. The rejection probability is accelerated by exploiting monotonicity of the posterior decision in the treatment-arm response count for each fixed control-arm response count.

Value

A one-row data frame with the following columns:

theta

True control arm response rate.

theta.t

True treatment arm response rate.

delta_true

True treatment effect, \tau = \theta_t - \theta.

method

Borrowing method used.

alternative

Direction of the posterior decision.

cutoff

Posterior probability cutoff used for decision making.

margin

Clinical margin used for inference.

reject_prob

Repeated-sampling rejection probability.

bias

Bias of the posterior mean estimator of \theta.

rmse

Root mean squared error of the posterior mean estimator of \theta.

mean_weight

Average borrowing weight under the specified method.


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