Learn R Programming

nmaINLA (version 1.1.0)

create_INLA_dat: 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.

Value

A data frame with the generated coloumns.

Details

The resulting data.frame can be used as data argument in nma_inla.

See Also

gemtc::mtc.data.studyrow

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab