getnmadata {MBNMAtime} | R Documentation |
Prepares NMA data for JAGS
Description
Converts data frame to a list for use in JAGS NMA model
Usage
getnmadata(data.ab, link = "identity", sdscale = FALSE)
Arguments
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
link |
Can take either |
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
Value
A named list of numbers, vector, matrices and arrays to be sent to JAGS. List elements are:
-
y
An array of mean responses for each observation in each arm within each study -
se
An array of standard errors for each observation in each arm within each study -
narm
A numeric vector with the number of arms per study -
NS
The total number of studies in the dataset -
NT
The total number of treatments in the dataset -
treat
A matrix of treatment codes within each study
Examples
# Using the alogliptin dataset
network <- mb.network(alog_pcfb)
# Construct a dataset with the latest time point in each study
data.ab <- get.latest.time(network)$data.ab
getnmadata(data.ab)