create_MetaStan_dat: Prepare model-based meta-analysis dataset for Stan.

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

View source: R/create_MetaStan_dat.R

Description

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

Usage

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

MetaStan documentation built on Jan. 22, 2022, 5:06 p.m.