Mixprior: Constructing a mixture prior for longitudinal data with...

View source: R/Mixprior.R

MixpriorR Documentation

Constructing a mixture prior for longitudinal data with informative dropout

Description

The Mixprior function constructs a mixture prior for longitudinal data with informative dropout by mixing an informative prior (built from the historical arm/posterior draws) and a non-informative (e.g., unit-information) prior. It supports both continuous (normMix) and binary (betaMix) outcomes and simply delegates to RBesT::mixcombine.

Usage

Mixprior(informative_prior, noninformative_prior, weight)

Arguments

informative_prior

Informative prior for \theta derived from historical data, represented as RBesT::normMix (continuous) or "betaMix" (binary).

noninformative_prior

Non-informative prior (e.g., unit-information for continuous outcome or Uniform(0,1) for binary outcome) of the same class as informative_prior:

  • Continuous: normMix. See also unit_information_prior().

  • Binary: "betaMix"; commonly RBesT::mixbeta(c(1,1,1)).

weight

Mixture weight assigned to the informative component (0 \leq weight \leq 1); may be a scalar w or a vector c(w, 1-w).

Value

A prior of the same class as informative_prior: normMix for continuous endpoints or "betaMix" for binary endpoints.

Examples

# --- Continuous endpoint (normMix) ---
set.seed(1000)
hist_draws <- rnorm(1000, mean = -3.2, sd = 0.35)
inf_prior_c  <- RBesT::mixfit(hist_draws, type = "norm", Nc = 3)  # informative
nf_prior_c   <- unit_information_prior(inf_prior_c, n_hist = 200) # unit-info
w_c <- 0.6  # (e.g., from SLB_weight)
prior_c <- Mixprior(informative_prior   = inf_prior_c,
                      noninformative_prior = nf_prior_c,
                      weight = w_c)
prior_c

# --- Binary endpoint (betaMix) ---
inf_prior_b <- RBesT::mixbeta(c(1, 20, 30))    # Beta(20,30) as one-component mix
nf_prior_b  <- RBesT::mixbeta(c(1, 1, 1))      # Uniform(0,1)
w_b <- 0.5
prior_b <- Mixprior(informative_prior   = inf_prior_b,
                      noninformative_prior = nf_prior_b,
                      weight = w_b)
prior_b

BDIB documentation built on Oct. 18, 2026, 5:08 p.m.

Related to Mixprior in BDIB...