| Mixprior | R Documentation |
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.
Mixprior(informative_prior, noninformative_prior, weight)
informative_prior |
Informative prior for |
noninformative_prior |
Non-informative prior (e.g., unit-information for continuous outcome or Uniform(0,1) for binary outcome)
of the same class as
|
weight |
Mixture weight assigned to the informative component
( |
A prior of the same class as informative_prior:
normMix for continuous endpoints or "betaMix" for binary endpoints.
# --- 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.