Set up a network containing arm-based aggregate data (AgD), such as event
counts or mean outcomes on each arm. Multiple data sources may be combined
once created using combine_network()
.
set_agd_arm(
data,
study,
trt,
y = NULL,
se = NULL,
r = NULL,
n = NULL,
E = NULL,
sample_size = NULL,
trt_ref = NULL,
trt_class = NULL
)
An object of class nma_data
a data frame
column of data
specifying the studies, coded using integers,
strings, or factors
column of data
specifying treatments, coded using integers,
strings, or factors
column of data
specifying a continuous outcome
column of data
specifying the standard error for a continuous
outcome
column of data
specifying a binary or Binomial outcome count
column of data
specifying Binomial outcome numerator
column of data
specifying the total time at risk for Poisson
outcomes
column of data
giving the sample size in each arm.
Optional, see details.
reference treatment for the network, as a single integer, string, or factor. If not specified, a reasonable well-connected default will be chosen (see details).
column of data
specifying treatment classes, coded using
integers, strings, or factors. By default, no classes are specified.
By default, trt_ref = NULL
and a network reference treatment will be chosen
that attempts to maximise computational efficiency and stability. If an
alternative reference treatment is chosen and the model runs slowly or has
low effective sample size (ESS) this may be the cause - try letting the
default reference treatment be used instead. Regardless of which treatment is
used as the network reference at the model fitting stage, results can be
transformed afterwards: see the trt_ref
argument of
relative_effects()
and predict.stan_nma()
.
The sample_size
argument is optional, but when specified:
Enables automatic centering of predictors (center = TRUE
) in nma()
when a regression model is given for a network combining IPD and AgD
Enables production of study-specific relative effects, rank probabilities, etc. for studies in the network when a regression model is given
Nodes in plot.nma_data()
may be weighted by sample size
If a Binomial outcome is specified and sample_size
is omitted, n
will be
used as the sample size by default. If a Multinomial outcome is specified and
sample_size
is omitted, the sample size will be determined automatically
from the supplied counts by default.
All arguments specifying columns of data
accept the following:
A column name as a character string, e.g. study = "studyc"
A bare column name, e.g. study = studyc
dplyr::mutate()
style semantics for inline variable transformations, e.g. study = paste(author, year)
set_ipd()
for individual patient data, set_agd_contrast()
for
contrast-based aggregate data, and combine_network()
for combining
several data sources in one network.
print.nma_data()
for the print method displaying details of the
network, and plot.nma_data()
for network plots.
# Set up network of smoking cessation data
head(smoking)
smk_net <- set_agd_arm(smoking,
study = studyn,
trt = trtc,
r = r,
n = n,
trt_ref = "No intervention")
# Print details
smk_net
# Plot network
plot(smk_net)
Run the code above in your browser using DataLab