create_INLA_dat: Prepare network meta-analysis dataset for INLA.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/create_INLA_dat.R

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

1
2
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, [email protected], Rafael Sauter and Gert van Valkenhoef

See Also

gemtc::mtc.data.studyrow

Examples

1
2
3
4
5
6
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)

gunhanb/nmainla documentation built on July 23, 2018, 3:28 p.m.