create_MetaStan_dat {MetaStan}R Documentation

Prepare model-based meta-analysis dataset for Stan.

Description

create_MetaStan_dat converts datasets in the one-study-per-row format to one-arm-per-row format,

Usage

create_MetaStan_dat(
  dat = NULL,
  armVars = c(dose = "d", responders = "r", sampleSize = "n"),
  nArmsVar = "nd"
)

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.

nArmsVar

Variable holding the number of arms for each study.

Details

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

Value

A data frame with the generated columns.

Author(s)

Burak Kuersad Guenhan, burak.gunhan@med.uni-goettingen.de and Gert van Valkenhoef

See Also

gemtc::mtc.data.studyrow and nmaINLA::create_INLA_dat

Examples

## Not run: 
data('dat.Eletriptan')
## Create the dataset suitable for MBMA_stan
EletriptanDat <- create_MetaStan_dat(dat = dat.Eletriptan,
                                     armVars = c(dose = "d",
                                                 responders = "r",
                                                 sampleSize = "n"),
                                     nArmsVar = 'nd')
## Check that the data are correct
print(EletriptanDat)

## End(Not run)

[Package MetaStan version 1.0.0 Index]