| Title: | Component, Dose, and Time Network Meta-Analysis with Dose-Dependent Interactions |
|---|---|
| Description: | Bayesian component model-based network meta-analysis for treatment combinations with explicit component dose-response and dose-dependent interaction surfaces. The main interface fits single-timepoint arm-level networks with continuous or binary outcomes, any number of components, additive, bilinear, or saturating pairwise interactions, study-level random effects, and prediction at unobserved dose combinations. A stage-one longitudinal interface fits a two-component exponential time-course model with a bilinear interaction on the asymptote. Estimation uses 'Stan' through 'cmdstanr' or 'rstan'. Methods are described in Welton et al. (2009) <doi:10.1093/aje/kwp014>, Mawdsley et al. (2016) <doi:10.1002/psp4.12091>, Wicha et al. (2017) <doi:10.1038/s41467-017-01929-y>, and Pedder et al. (2019) <doi:10.1002/jrsm.1351>. |
| Authors: | Tyler Pitre [aut, cre] |
| Maintainer: | Tyler Pitre <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.1 |
| Built: | 2026-07-22 12:25:48 UTC |
| Source: | https://github.com/cran/cdtmbnma |
Bayesian component model-based network meta-analysis for treatment combinations with explicit component dose-response and dose-dependent interaction surfaces. The main model supports single-timepoint arm-level networks with continuous or binary outcomes. A stage-one interface supports a two-component exponential time-course model for repeated arm means.
The single-timepoint workflow is cdt_data() followed by cdt_fit(),
or the one-call wrapper cdtmbnma(). Estimation uses Stan through either
cmdstanr or rstan. Fitted objects have summary(),
coef(), plot(), and predict() methods.
Additive component effects.
One parameter per component pair; the interaction grows with the product of normalised component doses.
A saturating general pharmacodynamic interaction surface.
Tyler Pitre
Reads the package's antihypertensive factorial extraction form or data dictionary.
antihtn_factorial_template(type = c("extraction", "dictionary"))antihtn_factorial_template(type = c("extraction", "dictionary"))
type |
Either |
A data frame.
Turns an arm-level data frame into the design consumed by cdt_fit().
Every component named in components must have a dose column, and zero
means the component is absent from that arm.
cdt_data(data, study, components, outcome = c("continuous", "binary"), y = NULL, se = NULL, sd = NULL, n = NULL, events = NULL, n_binary = NULL, ref = NULL, dstar = NULL, interactions = NULL)cdt_data(data, study, components, outcome = c("continuous", "binary"), y = NULL, se = NULL, sd = NULL, n = NULL, events = NULL, n_binary = NULL, ref = NULL, dstar = NULL, interactions = NULL)
data |
A data frame with one row per study arm. |
study |
Name of the column identifying the study. |
components |
Character vector of component dose column names. A value of zero marks the component absent. |
outcome |
Either |
y |
For a continuous outcome, the arm mean column. |
se |
For a continuous outcome, the arm standard error column. Supply this or both |
sd, n
|
For a continuous outcome, columns of arm standard deviation and sample size. |
events, n_binary
|
For a binary outcome, event-count and sample-size columns. |
ref |
Optional column flagging exactly one within-study reference arm per study. |
dstar |
Optional named numeric vector of dose-normalisation references for the bilinear surface. |
interactions |
|
An object of class cdt_data.
df <- data.frame(study = c("s1", "s1", "s1"), A = c(0, 1, 1), B = c(0, 0, 1), y = c(0, -1, -2), se = c(1, 1, 1)) d <- cdt_data(df, study = "study", components = c("A", "B"), outcome = "continuous", y = "y", se = "se") ddf <- data.frame(study = c("s1", "s1", "s1"), A = c(0, 1, 1), B = c(0, 0, 1), y = c(0, -1, -2), se = c(1, 1, 1)) d <- cdt_data(df, study = "study", components = c("A", "B"), outcome = "continuous", y = "y", se = "se") d
Reads a CSV file installed with the package.
cdt_extdata(name)cdt_extdata(name)
name |
Filename under |
A data frame.
Compiles the Stan model on first use and samples the posterior.
cdt_fit(data, interaction = c("bilinear", "none", "gpdi"), priors = cdt_priors(), newdata = NULL, backend = "auto", chains = 4, iter_warmup = 1000, iter_sampling = 1000, adapt_delta = 0.95, seed = 1, refresh = 0, ...)cdt_fit(data, interaction = c("bilinear", "none", "gpdi"), priors = cdt_priors(), newdata = NULL, backend = "auto", chains = 4, iter_warmup = 1000, iter_sampling = 1000, adapt_delta = 0.95, seed = 1, refresh = 0, ...)
data |
A |
interaction |
Interaction surface: |
priors |
A named list from |
newdata |
Optional data frame of component-dose combinations for Stan generated-quantities predictions. |
backend |
One of |
chains, iter_warmup, iter_sampling
|
Sampler settings. |
adapt_delta |
Target acceptance probability passed to the Stan backend. |
seed |
Random seed. |
refresh |
Console refresh interval. |
... |
Passed to the backend sampler. |
The additive model uses interaction = "none". The bilinear model uses one
interaction parameter per co-occurring component pair. The "gpdi" model
uses a saturating surface adapted from the general pharmacodynamic interaction
model.
An object of class cdtmbnma.
sv <- sacval_example() d <- cdt_data(sv, "study", c("d_sac", "d_val"), outcome = "continuous", y = "y", se = "se", dstar = c(d_sac = 200, d_val = 320)) # Fitting needs a Stan backend, and the Stan model is compiled on first use. if (requireNamespace("rstan", quietly = TRUE)) { fit <- cdt_fit(d, interaction = "bilinear", backend = "rstan", chains = 2, iter_warmup = 500, iter_sampling = 500) summary(fit) }sv <- sacval_example() d <- cdt_data(sv, "study", c("d_sac", "d_val"), outcome = "continuous", y = "y", se = "se", dstar = c(d_sac = 200, d_val = 320)) # Fitting needs a Stan backend, and the Stan model is compiled on first use. if (requireNamespace("rstan", quietly = TRUE)) { fit <- cdt_fit(d, interaction = "bilinear", backend = "rstan", chains = 2, iter_warmup = 500, iter_sampling = 500) summary(fit) }
Creates prior hyperparameters for cdt_fit().
cdt_priors(emax_sd = 10, logED50_mean = log(50), logED50_sd = 1, int_sd = 5, ref_sd = 10, omega_sd = 2)cdt_priors(emax_sd = 10, logED50_mean = log(50), logED50_sd = 1, int_sd = 5, ref_sd = 10, omega_sd = 2)
emax_sd |
Prior standard deviation for component Emax values. |
logED50_mean, logED50_sd
|
Prior mean and standard deviation for log half-maximal dose values. |
int_sd |
Prior standard deviation for interaction parameters. |
ref_sd |
Prior standard deviation for per-study reference levels. |
omega_sd |
Half-normal prior scale for the random-effect standard deviation. |
A named list of prior hyperparameters.
Builds data for the two-component exponential time-course model.
cdt_time_data(data, study, arm, time, components, y, se = NULL, sd = NULL, n = NULL, ref = NULL, dstar = NULL)cdt_time_data(data, study, arm, time, components, y, se = NULL, sd = NULL, n = NULL, ref = NULL, dstar = NULL)
data |
A long data frame with one row per study-arm-time observation. |
study |
Name of the study column. |
arm |
Name of the arm column. |
time |
Name of the follow-up time column. |
components |
Character vector naming exactly two component dose columns. |
y, se
|
Outcome mean and standard error columns. |
sd, n
|
Optional standard deviation and sample-size columns used to derive |
ref |
Optional column flagging the reference arm. |
dstar |
Optional named numeric vector of two dose-normalisation references. |
An object of class cdt_time_data.
Fits the stage-one longitudinal Stan model with an exponential time-course.
cdt_time_fit(data, priors = cdt_time_priors(), newdata = NULL, backend = "auto", chains = 4, iter_warmup = 1000, iter_sampling = 1000, adapt_delta = 0.95, seed = 1, refresh = 0, ...)cdt_time_fit(data, priors = cdt_time_priors(), newdata = NULL, backend = "auto", chains = 4, iter_warmup = 1000, iter_sampling = 1000, adapt_delta = 0.95, seed = 1, refresh = 0, ...)
data |
A |
priors |
A named list from |
newdata |
Optional data frame of two-component dose combinations. |
backend |
One of |
chains, iter_warmup, iter_sampling
|
Sampler settings. |
adapt_delta |
Target acceptance probability. |
seed |
Random seed. |
refresh |
Console refresh interval. |
... |
Passed to the backend sampler. |
An object of class cdt_timefit.
Creates prior hyperparameters for cdt_time_fit().
cdt_time_priors(ref_E_sd = 5, ref_lograte_mean = -3, ref_lograte_sd = 1, emax_sd = 10, logED50_mean = 0, logED50_sd = 1, eta_sd = 5, rate_sd = 1, omega_E_sd = 2, omega_k_sd = 0.5)cdt_time_priors(ref_E_sd = 5, ref_lograte_mean = -3, ref_lograte_sd = 1, emax_sd = 10, logED50_mean = 0, logED50_sd = 1, eta_sd = 5, rate_sd = 1, omega_E_sd = 2, omega_k_sd = 0.5)
ref_E_sd |
Prior standard deviation for study-specific reference asymptotes. |
ref_lograte_mean, ref_lograte_sd
|
Prior mean and standard deviation for study-specific reference log rates. |
emax_sd |
Prior standard deviation for component Emax values. |
logED50_mean, logED50_sd
|
Prior mean and standard deviation for log half-maximal dose values. |
eta_sd |
Prior standard deviation for the bilinear interaction. |
rate_sd |
Prior standard deviation for component log-rate dose effects. |
omega_E_sd, omega_k_sd
|
Half-normal prior scales for random-effect standard deviations. |
A named list of prior hyperparameters.
Convenience wrapper that builds the design with cdt_data() and fits it
with cdt_fit().
cdtmbnma(data, study, components, outcome = c("continuous", "binary"), y = NULL, se = NULL, sd = NULL, n = NULL, events = NULL, n_binary = NULL, ref = NULL, dstar = NULL, interactions = NULL, interaction = c("bilinear", "none", "gpdi"), priors = cdt_priors(), newdata = NULL, backend = "auto", chains = 4, iter_warmup = 1000, iter_sampling = 1000, adapt_delta = 0.95, seed = 1, refresh = 0, ...)cdtmbnma(data, study, components, outcome = c("continuous", "binary"), y = NULL, se = NULL, sd = NULL, n = NULL, events = NULL, n_binary = NULL, ref = NULL, dstar = NULL, interactions = NULL, interaction = c("bilinear", "none", "gpdi"), priors = cdt_priors(), newdata = NULL, backend = "auto", chains = 4, iter_warmup = 1000, iter_sampling = 1000, adapt_delta = 0.95, seed = 1, refresh = 0, ...)
data, study, components, outcome, y, se, sd, n, events, n_binary, ref, dstar, interactions
|
Passed to |
interaction, priors, newdata, backend, chains, iter_warmup, iter_sampling, adapt_delta, seed, refresh, ...
|
Passed to |
An object of class cdtmbnma.
# Fitting needs a Stan backend, and the Stan model is compiled on first use. if (requireNamespace("rstan", quietly = TRUE)) { fit <- cdtmbnma(sacval_example(), study = "study", components = c("d_sac", "d_val"), outcome = "continuous", y = "y", se = "se", backend = "rstan", chains = 2, iter_warmup = 500, iter_sampling = 500) summary(fit) }# Fitting needs a Stan backend, and the Stan model is compiled on first use. if (requireNamespace("rstan", quietly = TRUE)) { fit <- cdtmbnma(sacval_example(), study = "study", components = c("d_sac", "d_val"), outcome = "continuous", y = "y", se = "se", backend = "rstan", chains = 2, iter_warmup = 500, iter_sampling = 500) summary(fit) }
Extracts long-term component coefficient summaries.
## S3 method for class 'cdt_timefit' coef(object, ...)## S3 method for class 'cdt_timefit' coef(object, ...)
object |
A fitted |
... |
Unused. |
A data frame with Emax and ED50 summaries for the two components.
Extracts component dose-response coefficient summaries.
## S3 method for class 'cdtmbnma' coef(object, ...)## S3 method for class 'cdtmbnma' coef(object, ...)
object |
A fitted |
... |
Unused. |
A data frame with posterior summaries for component Emax and ED50 values.
Reads the package's COPD BGF extraction form or data dictionary.
copd_bgf_template(type = c("extraction", "dictionary"))copd_bgf_template(type = c("extraction", "dictionary"))
type |
Either |
A data frame.
Draws marginal component dose-response curves with posterior credible bands.
## S3 method for class 'cdtmbnma' plot(x, ngrid = 60, probs = c(0.025, 0.975), ...)## S3 method for class 'cdtmbnma' plot(x, ngrid = 60, probs = c(0.025, 0.975), ...)
x |
A fitted |
ngrid |
Number of dose points per curve. |
probs |
Two quantiles for the credible band. |
... |
Passed to |
Invisibly, a list of plotted grids.
Computes long-term asymptotic relative effects for the stage-one longitudinal model.
## S3 method for class 'cdt_timefit' predict(object, newdata, probs = c(0.025, 0.975), ...)## S3 method for class 'cdt_timefit' predict(object, newdata, probs = c(0.025, 0.975), ...)
object |
A fitted |
newdata |
Data frame carrying the two component-dose columns used in fitting. |
probs |
Quantiles for credible intervals. |
... |
Unused. |
A data frame with doses, posterior mean, posterior standard deviation, and requested quantiles.
Computes posterior relative effects against the all-zero reference at arbitrary component-dose combinations.
## S3 method for class 'cdtmbnma' predict(object, newdata, probs = c(0.025, 0.975), ...)## S3 method for class 'cdtmbnma' predict(object, newdata, probs = c(0.025, 0.975), ...)
object |
A fitted |
newdata |
Data frame carrying the component dose columns used in fitting. |
probs |
Quantiles for credible intervals. |
... |
Unused. |
A data frame with doses, posterior mean, posterior standard deviation, and requested quantiles.
Reads the package's sacubitril/valsartan example data.
sacval_example()sacval_example()
A data frame with columns study, arm, d_sac, d_val, n, y, sd, se, and sd_source.
head(sacval_example())head(sacval_example())
Summarises key structural parameters in a cdt_timefit object.
## S3 method for class 'cdt_timefit' summary(object, ...)## S3 method for class 'cdt_timefit' summary(object, ...)
object |
A fitted |
... |
Unused. |
A data frame of posterior summaries and convergence diagnostics.
Summarises the structural parameters of a cdtmbnma fit.
## S3 method for class 'cdtmbnma' summary(object, ...)## S3 method for class 'cdtmbnma' summary(object, ...)
object |
A fitted |
... |
Unused. |
A data frame of posterior summaries and convergence diagnostics.