A new connect_baseline argument to nma() allows users to connect networks
that are disconnected or include single-arm studies, under strong assumptions
about predicting absolute outcomes between disconnected components/studies.
The new con() function specifies the type of baseline connection to use,
either:
The latter allows for additional uncertainty due to residual variation in
baseline risk (i.e. unobserved prognostic factors or effect modifiers) to be
incorporated. The random baseline distribution may be estimated first by
fitting a baseline synthesis model, with the new baseline_synthesis()
function (see below).
The strong assumption of (conditional, with a regression model) constancy of absolute effects may be assessed by:
compare_populations() function to compute the effective sample size overlap
between the joint covariate distributions, or the standardised Euclidean
distance between the mean covariate values.bayes_R2() and
loo_R2() functions, and/or investigating the leave-one-out cross validation
predictive performance with the new loo_predictive_metric() function.The new allow_single_arm argument to the set_*() functions (and associated
global option multinma.allow_single_arm) controls the behaviour when
single-arm studies are included in the network at setup stage. By default a
warning will be given (except for survival data), but this can be changed to an
error or an information message.
baseline_synthesis() function fits baseline synthesis models. A
random effect is placed on the (adjusted) study-specific baseline (intercept)
parameters, to obtain a pooled estimate of the absolute outcomes on the network
reference treatment.connect_baseline argument of nma(), and to judge the magnitude of
unexplained variation in absolute outcomes between studies.bind_chains() combines multiple runs of the same model
into a single model object. For MCMC arrays, a new cbind.mcmc_array() method
combines multiple MCMC arrays containing samples of the same parameters into a
single MCMC array.debug option to nma(). When TRUE, the model will not be
fitted and instead a list of input data to Stan is returned.allow_mixed_studies argument to combine_network() allows
studies to be included in more than one data type.relative_effects() now works when newdata contains
integration points. Furthermore, relative_effects() will now ask for
integration points to be provided for models that involve non-linear covariate
terms, so that these can be averaged over correctly.sigma in
models with a Normal likelihood and IPD are now labelled informatively.dic() for models with IPD and a Normal likelihood, caused by
dplyr deprecation..mu
special variable for regression formulas which can interact with treatment,
e.g. regression = ~.mu:.trt. Following TSD3, the regression is performed on
the estimated intercept parameter not the observed baseline risk, to correctly
capture uncertainty and account for correlations between baseline risk and
treatment effect. A new Certolizumab vignette demonstrates the new features.
Thanks to @ndunnewind (PR #36).subset argument to posterior_ranks() and
posterior_rank_probs() allows ranks to be calculated for a smaller decision
set of treatments than the full analysis set.knots.stan_nma() method for easily obtaining the knots from a
fitted M-spline or piecewise exponential model, rather than working with the
spline basis objects fit$basis (#53).expand argument for predict.stan_nma(), to allow predictions
to be made only for observed treatments in each study/for each individual
rather than expanding out predictions for every treatment.predict() now works correctly for newdata when aux_by was used,
rather than giving errors (including #50).predict() no longer errors when using a single baseline for multiple
newdata studies.aux_regression model on the
auxiliary shape parameters gave an error when trying to use predict() or
marginal_effects() (#62).predict() for models where study names include special regex
characters (e.g. parentheses like "Smith (2025)") no longer fails when these
studies are used to inform the baseline or aux arguments (#63).class_effects argument in nma() allows models with independent,
exchangeable, or common class effects to be fitted. Class standard deviations
can also be shared between classes or subsets of classes, controlled by the
class_sd argument. These features are demonstrated in a new vignette,
analysing a network of interventions for social anxiety.plot.nma_dic(), with the
option type = "leverage".combine_network(), where previously these were discarded. One potential use
case is to specify different types of marginal distributions or correlation
structures for different AgD studies in the network, by setting these up
separately with add_integration() before combining with combine_network().as.data.frame.nma_dic() and as_tibble.nma_dic() methods
that return data frames of the pointwise contributions to the DIC, and
as.matrix.nma_dic() and as.array.nma_dic() methods that return posterior
samples of the residual deviances as a matrix or 3D array.softmax() and inv_softmax() transforms are now exported.r = n on all arms) no longer give NaN residual deviance.aux_regression = ~.trt were incorrectly omitting the treatment
effects on the auxiliary parameter(s) in some cases (#43).marginal_effects() for survival outcomes with a single target
population previously gave an error.aux_regression had been
specified were giving an error (#44). aux_regression and aux_by have no
effect for exponential models since there are no auxiliary (shape) parameters
and are ignored, now with a warning.c().predict() outside of a plot() call no longer gives an error
(#40).marginal_effects() function produces marginal treatment
effects, as a wrapper around absolute predictions from predict(). For example,
for an analysis with a binary outcome marginal odds ratios, risk ratios, or risk
differences may be produced. For survival outcomes, marginal effects may be
based on the full range of predictions produced by predict(), such as marginal
differences in restricted mean survival times, or time-varying marginal hazard
ratios.predict() or marginal_effects() from ML-NMR models that
may take longer to run. These can be controlled with the new progress
argument.trt_ref argument to predict() has been renamed to
baseline_ref; using trt_ref is now soft-deprecated. Renaming this argument
baseline_ref follows the naming convention for the other arguments
(baseline_type, baseline_level) that specify the details of a provided
baseline distribution. This also makes way for the new marginal_effects()
functionality.predict() for AgD meta-regression models with new data
and baseline_type = "response" to fail with an error.plot.nma_data()
with weight_edges = TRUE was incorrect when a study had multiple arms of the
same treatment. This now correctly counts the number of studies making a
comparison, rather than the number of arms.set_ipd() now has a Surv argument for specifying survival outcomes using
survival::Surv(), and a new function set_agd_surv() sets up aggregate data
in the form of event/censoring times (e.g. from digitized Kaplan-Meier curves)
and overall covariate summaries.aux_by argument to nma().aux_regression argument to nma(), allowing non-proportionality to be
modelled by treatment and/or covariate effects on the shapes or spline
coefficients.predict() method produces estimates of survival probabilities, hazards,
cumulative hazards, mean survival times, restricted mean survival times,
quantiles of the survival time distribution, and median survival times. All of
these predictions can be plotted using the plot() method.geom_km() function assists in plotting Kaplan-Meier curves from a
network object, for example to overlay these on estimated survival curves. The
transform argument can be used to produce log-log plots for assessing the
proportional hazards assumption, along with cumulative hazards or log survival
curves.ndmm_ipd, ndmm_agd,
and ndmm_agd_covs.n_int and half with n_int/2 integration points. Any Rhat or effective sample
size warnings can then be ascribed to either: non-convergence of the MCMC
chains, requiring increased number of iterations iter in nma(), or;
insufficient accuracy of numerical integration, requiring increased number of
integration points n_int in add_integration(). Descriptive warning messages
indicate which is the case.int_check argument to nma(), which is
enabled (TRUE) by default.int_thin = 0, and is now disabled by default. The previous default was
int_thin = max(n_int %/% 10, 1).n_int in add_integration() has been lowered to 64.
This is still a conservative choice, and will be sufficient in many cases; the
previous default of 1000 was excessive.n_int and disabling saving cumulative integration points.dic() now includes an option to use the pV penalty instead of pD.baseline and aux arguments to predict() can now be
specified as the name of a study in the network, to use the parameter estimates
from that study for prediction.predict() will now produce aggregate-level predictions over a
sample of individuals in newdata for ML-NMR models (previously newdata had
to include integration points).plot.mcmc_array() method, as a shortcut for
plot(summary(x), ...).plot.nma_data(), using a custom layout that is not a string (e.g.
a data frame of layout coordinates) now works as expected when nudge > 0.as.tibble.stan_nma() and as_tibble.stan_nma() methods,
to complement the existing as.data.frame.stan_nma().weight_nodes = TRUE, using the new nudge argument to
plot.nma_data() (#15).as_tibble() or as.data.frame()
on an nma_summary object (such as relative effects or predictions) now
includes columns for the corresponding treatment (.trt) or contrast (.trta
and .trtb), and a .category column may be included for multinomial models.
Previously these details were only present as part of the parameter columnlog_student_t(), which can be used
for positive-valued parameters (e.g. heterogeneity variance).set_agd_contrast() now produces an informative error message
when the covariance matrix implied by the se column is not positive definite.
Previously this was only checked by Stan after calling the nma() function..trtclass special in regression
formulas, now main effects of .trtclass are always removed since these are
collinear with .trt. This allows expansion of interactions with * to work
properly, e.g. ~variable*.trtclass, whereas previously this resulted in an
over-parametrised model.get_nodesplits() when studies have multiple arms of the same
treatment.print.nma_data() now prints the repeated arms when studies have
multiple arms of the same treatment.NA in
multi()) (PR #11)consistency = "nodesplit" in nma(). Comparisons to split can be chosen
using the nodesplit argument, by default all possibly inconsistent comparisons
are chosen using get_nodesplits(). Node-splitting results can be summarised
with summary.nma_nodesplit() and plotted with plot.nodesplit_summary().add_integration() for ML-NMR models is now adjusted to the underlying Gaussian
copula, so that the output correlations of the integration points better match
the requested input correlations. A new argument cor_adjust controls this
behaviour, with options "spearman", "pearson", or "none". Although these
correlations typically have little impact on the results, for strict
reproducibility the old behaviour from version 0.3.0 and below is available with
cor_adjust = "legacy".relative_effects() and predict.stan_nma() respectively, using the new
argument predictive_distribution = TRUE.posterior_ranks() or posterior_rank_probs(), when
argument sucra = TRUE.trt, study, or trt_class
are factors, previously the order of levels was reset into natural sort order.options("contrasts").plot.nma_data() no longer gives a ggplot deprecation warning (PR #6).predict.stan_nma() with a single covariate when newdata is a
data.frame (PR #7).predict.stan_nma() on a regression model with only
contrast data and no newdata or baseline specified now throws a descriptive
error message.baseline_type and baseline_level arguments to
predict.stan_nma(), which allow baseline distributions to be specified on the
response or linear predictor scale, and at the individual or aggregate level.baseline argument to predict.stan_nma() can now accept a
(named) list of baseline distributions if newdata contains multiple studies.newdata arguments to functions like
relative_effects() and predict.stan_nma() now give more informative error
messages.--run-donttest run correctly.relative_effects() with all_contrasts = TRUE no longer gives an error for
regression models.cor in add_integration()
is not required when only one covariate is present.likelihood and link arguments in
nma()).set_*() functions now accept dplyr::mutate() style semantics,
allowing inline variable transformations.multi() for
specifying the outcomes. Accompanied by a new data set hta_psoriasis and
vignette.flat().as.array.stan_nma() is now much more efficient, meaning that
many post-estimation functions are also now much more efficient.plot.nma_dic() is now more efficient, particularly with large
numbers of data points.plot.nma_dic() with multiple data types has been reversed for improved clarity
(now AgD over the top of IPD).predict() from ML-NMR / IPD
regression models are now calculated in a much more memory-efficient manner.weight_edges = TRUE no longer produce
legends with non-integer values for the number of studies.plot.nma_dic() no longer gives an error when attempting to specify
.width argument when producing "dev-dev" plots.\donttest{} instead of \dontrun{}plot() method for nma_data objects.as.igraph(), as_tbl_graph() methods for nma_data objects.relative_effects(),
posterior ranks with posterior_ranks(), and posterior rank probabilities with
posterior_rank_probs(). These will be study-specific when a regression model
is given.predict() method for
stan_nma objects.plot.nma_summary().sample_size argument for set_agd_*() that:
center = TRUE) in nma() when
a regression model is given, replacing the agd_sample_size argument of nma()plot() method for nma_dic objects produced by dic().link = "cloglog" for
binomial likelihoods.prior_het_type.plot_prior_posterior().pairs().