modelsummary():
tidiers now accept its neutral vcov = NULL and
coef_rename = FALSE arguments while retaining posterior SDs
and equal-tailed credible intervals. Unsupported covariance overrides
still produce an error; table labels can be changed with
coef_map.bdplm() no
longer adds unintended covariate columns under
method = "mc", and logistic posterior draws contain only
the intercept and treatment effect. Posterior columns are selected by
name in both regressions.bdplogit() now defaults to its supported
"fixed" method and uses distinct seeds drawn from R’s
random-number state for its two comparisons and final fit.
set.seed() controls reproducibility, and stage seeds are
retained in args1$mcmc_seeds. Results will differ from
earlier versions that always used MCMCpack’s default seed.bdpsurvival() now uses evaluated survival responses,
supporting transformed times, event expressions, named arguments, and
survival::Surv(). Missing responses, unsupported censoring
types, and invalid treatment codes cause explicit errors before interval
splitting. Valid one-arm and historical-only-control analyses remain
supported.bdplogit() now stops with a stage-specific explanation
when complete or quasi-complete separation, or a rank-deficient model
matrix, prevents a supported analysis. Checks cover each arm’s borrowing
comparison, the historical regression when arm priors are estimated, and
the current-data regression. This prevents borrowing weights from
improper comparison posteriors and historical priors derived from
infinite maximum likelihood estimates. The current-data check reflects a
limitation of the sampler, including when proper priors are
supplied.fix_alpha = TRUE, bdplogit() now uses
the prescribed arm weights without fitting comparison models; internal
comparison probabilities are recorded as missing. Historical-prior
estimation and current-data checks still apply. Prescribed weights must
be finite values in [0, 1].bdplm() and bdplogit() now reject formula
offsets before fitting instead of silently omitting them. This includes
stats::offset(), zero offsets, and cancelling offsets,
regardless of the borrowing settings or supplied historical priors.
Offset models fitted with earlier versions must be reconsidered; their
results do not represent the specified model.a0 + D + alpha * D0, and the rate is
b0 + T + alpha * T0, removing the extra
alpha * a0 and alpha * b0 contributions.method = "fixed" and
method = "mc" (#16).p_hat consistent with the chosen comparison method
when fix_alpha = TRUE, while preserving the prescribed
weight. Added checks for invalid prior, horizon, and borrowing settings,
and corrected interval handling for a single constant hazard and
intervals with no observations.probability_discount() helper
to standardize Monte Carlo mean differences by their conditional
standard error, matching bdpnormal() and preserving the
comparison when outcome units change.alpha_max for each
arm and to show a constant weight when
fix_alpha = TRUE.Added centering = "pooled", "current",
"historical", or "none" to
bdplm() and bdplogit(). The default preserves
pooled centering; "none" leaves covariates unchanged. Mean
centering uses both treatment arms in the selected data, without
discount weighting, and applies the same means to both datasets. Fits
retain the choice and subtracted values. Changing the reference can
change the estimated treatment effect and its posterior uncertainty
under the independent historical arm priors, even after transforming the
intercept back to the original covariate scale.
Added coef(), vcov(), and
confint() for linear and logistic regression fits. These
return posterior mean coefficients, their posterior covariance, and
equal-tailed credible intervals on the original covariate scale. Added
nobs() for all fitted models, counting current participants
separately from historical participants.
Added posterior::as_draws_df() and
posterior::as_draws_matrix() for all fitted models.
Conversions preserve retained draws and their order, including paired
arm differences, regression residual SDs, and survival interval log
hazards. The posterior package is optional.
Added tidy() and glance() methods for
all fitted models, also available through broom. tidy()
reports posterior estimates, SDs, and optional equal-tailed credible
limits; logistic and two-arm survival effects can be exponentiated.
glance() reports current and historical sample sizes,
retained draw counts, and arm-specific discount weights, with event
counts for survival fits.
Numerical summaries are shared with summary(). The
new methods use saved draws without refitting or changing the
random-number state. Participant-level augment() methods
are not provided.
Added type = "effect" plots for binomial and normal
treatment-minus-control contrasts. Posterior plots now use explicit
parameter labels and consistent information-source colours and line
types.
Added a light/dark mode switch to the pkgdown website, including matching colours for R code.
offset remain supported.R CMD check runs it, and declared the existing
withr test dependency.detectseparation for logistic separation checks
and documented the supported fitting conditions and the distinction
between prescribed and estimated weights. Logistic sampling still
requires method = "fixed".alpha from the Gamma shape a0, and interpret
current-only and full-borrowing limits. Regenerated the worked examples
with the corrected update.bdplm() and bdplogit() producing
invalid historical borrowing when covariates were not mean-centered.
Because the models use an intercept-free parameterization (separate
treatment and control means), uncentered covariates made the arm-mean
estimators strongly correlated and inflated their standard errors as
extrapolation errors at covariate = 0, corrupting the (diagonal)
discount prior. Both functions now automatically mean-center covariates
on their pooled (current plus historical) mean and back-transform the
reported intercept, so estimates are invariant to covariate location
shifts (#1).summary methods for
bdpnormal and bdpbinomial read the
one-/two-arm indicator from the wrong list element (args
instead of args1), causing two-arm fits to be summarised as
one-arm.bdpsurvival summary that
errored when current control data were absent.Y[, 0]) used when
computing the default surv_time in
bdpsurvival.compare argument being silently dropped
(passed into paste()) rather than stored in the
bdpnormal and bdpbinomial fit objects.mc discount-weight Z-statistic in
bdplm to divide by the standard error rather than the
variance.plot methods hanging on the interactive “Hit
par(ask = ...) now respects
interactive().bdplogit() failing during its main model fit
because the analysis data passed to MCMClogit() omitted the
response variable. The discounted prior precision matrix is now also
passed to MCMClogit() correctly (#12).alpha_discount() so alpha_max is
respected when discount_function = "identity" (#6).bdpnormal() one-arm normal fits with only one
source of data for an arm (current-only or historical-only internally)
returning an over-dispersed posterior_mu. These branches
now return the conjugate posterior of the mean rather than adding an
extra observation-level draw (posterior-predictive-like variance)
(#15).testthat test harness
(tests/testthat.R).expect_*() assertions:
augmented one-arm binomial and normal posterior means are pinned against
their closed-form conjugate values, and the fixed bugs (one-/two-arm
dispatch, stored compare flag, default survival time,
two-arm survival summary) are now guarded by tests. Plot calls in tests
pass an explicit type so they no longer prompt for
input.alpha_discount() and probability_discount()
(both now fully covered), the ppexp() vector and matrix
paths, the print methods (now fully covered), additional
plot branches, input-validation paths, the
bdplogit() main fit path, factor-covariate handling in
bdplm() and bdplogit(), and the
mc discounting method for bdpnormal and
bdpbinomial.bdpnormal flat-prior
draw of the mean (posterior_flat_mu) and the fixed
current-only posterior_mu against their closed-form
conjugate (Student-t) variance.method="mc" documentation in the binomial,
normal, and survival interfaces/vignettes to note that per-iteration
recomputation of the stochastic comparison yields a random
alpha_discount sequence that can show noticeable Monte
Carlo variability (#4).Rplots.pdf.prior_covariate_sd documentation in
bdplm() and bdplogit() to note that covariate
effects carry an intentional near-zero discount weight, making their
priors effectively flat. The supplied value has negligible influence on
the posterior, and the effective prior standard deviation is roughly 1e6
larger than the nominal value at the default (#2).r-lib/actions examples (actions/checkout@v6,
codecov/codecov-action@v6,
actions/upload-artifact@v7).pkgdown website and accompanying GitHub Actions
workflow.ggplot2::aes_string() with
aes() and the .data pronoun in all
plot methods.size aesthetic with
linewidth in geom_line() calls.model.matrixBayes() helper
(previously defined identically in both bdplm and
bdplogit) into a single internal file.posterior_survival() where both branches initialized
identical hazard matrices (#8).mc sigma2 sampling in bdplm()
and kept the sampling weights aligned with the candidate grid when some
marginal log-likelihoods are non-finite (#9).ppexp() now validates its x argument and
errors with an informative message when it is neither a numeric vector
nor a matrix (#10).plot and summary
methods are now computed with a vectorised C++ routine
(ppexpMV) that transposes the hazard matrix once across all
time points, instead of looping ppexp() per time point
(#11).posterior_survival(); the augmentation step now reuses the
values already computed during the discount phase (#7).useDynLib() directive in the
package namespace.NEWS.md
subsection convention for future releases.README.md with links, supported analyses,
examples, and citation guidance (#13).DESCRIPTION (#14).posterior_normal() that the flat-prior
draw of the mean is the conjugate posterior (scale
sqrt(sigma^2 / N)), not the posterior predictive.params/EVAL
scaffolding from the vignette headers.bdpbinomial,
bdpnormal, and bdpsurvival.bdpsurvival.stop break to discount_logit for
method = mc.bdplm vignette typo fixes.bdpsurvival.
method = "mc" of
the bdpbinomial and bdpnormal functions.bdplm now exists and mimics
lm.bdpbinomial vignette language around success
(vs event).bdpsurvival print
method adjusted to current data only.bdplm function for two-arm trials.discount_function input.
bdpregression.method = "mc" switched from
pshisq to pnorm.print input to plot method.type.bdpbinomial,
bdpnormal, and bdpsurvival.fix_alpha input which allows users to
set the historical data weight at alpha_max.two_side input to logical.print, summary, plot
methods.bdpnormal / bdpbinomial.