create_INLA_dat {nmaINLA} | R Documentation |
Prepare network meta-analysis dataset for INLA.
Description
create_INLA_dat
converts datasets in the one-study-per-row format to one-arm-per-row format
, then adds indicator (dummy) variables for the basic contrasts,
heterogeneity random effects and design-specific inconsistency random effects and for
correlated multi-arm trials.
Usage
create_INLA_dat(
dat = dat,
armVars = c(treatment = "t", responders = "r", sampleSize = "n"),
covariate = "cov",
design = "des",
nArmsVar = "na"
)
Arguments
dat |
Data in one-study-per-row format. |
armVars |
Vector of per-arm variables The name of each component will be the column name in the resulting dataset. |
covariate |
Optional. Vector of study-specific covariate |
design |
Optional. Vector of study-specific design. We refer design for the set of treatments in each trial. |
nArmsVar |
Variable holding the number of arms for each study. |
Details
The resulting data.frame can be used as data argument in nma_inla
.
Value
A data frame with the generated coloumns.
Author(s)
Burak Kuersad Guenhan, burak.gunhan@med.uni-goettingen.de, Rafael Sauter and Gert van Valkenhoef
See Also
gemtc::mtc.data.studyrow
Examples
data('Smokdat')
## Create the dataset suitable for INLA
SmokdatINLA <- create_INLA_dat(dat = Smokdat, armVars = c('treatment' = 't', 'responders' = 'r'
,'sampleSize' = 'n'), nArmsVar = 'na')
## Check that the data are correct
print(SmokdatINLA)